-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(workflow): pre-release * feat(workflow): exit pre-release * chore(workflow): update version & publish commands * fix(workflow): add missing attributes and use schangeset:beta cmd * feat(root): add changeset:beta * fix(workflows): revise pre-release logic * fix(workflows): add missing run * fix(workflows): use changeset:exit with version instead * feat(root): add changeset:exit cmd * refactor(workflows): add pths, id, and format * feat(workflows): enter pre-release mode * chore(workflows): remove pre.json only * refactor(workflows): remove enter-pre-release-mode * fix(workflows): incorrect url * refactor(root): remove unused exit command * refactor(workflows): add comments * feat(changeset): change to main branch as baseBranch * feat(root): add changeset:canary * refactor(workflows): remove unused workflow * feat(workflow): support canary pre-release mode * refactor(docs): change to canary
- Loading branch information
Showing
9 changed files
with
144 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Enter pre-release mode | ||
on: workflow_dispatch | ||
|
||
jobs: | ||
enter-pre-release-mode: | ||
if: ${{ github.ref == 'refs/heads/beta/release-next' || github.ref == 'refs/heads/canary' }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
id-token: write | ||
steps: | ||
- name: Checkout branch | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install | ||
uses: ./.github/common-actions/install | ||
|
||
- name: Enter pre-release mode | ||
id: enter-pre-release-mode | ||
run: | | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config user.name "github-actions[bot]" | ||
if [ ${{ github.ref }} == 'refs/heads/canary' ]; then | ||
pnpm changeset:canary | ||
else | ||
pnpm changeset:beta | ||
fi | ||
git add -A | ||
git commit -m 'chore(pre-release): enter pre-release mode' | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Exit pre-release mode | ||
|
||
on: workflow_dispatch | ||
jobs: | ||
exit-pre-release-mode: | ||
if: ${{ github.ref == 'refs/heads/beta/release-next' || github.ref == 'refs/heads/canary' }} | ||
name: exit pre-release mode | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.branch }} | ||
fetch-depth: 0 | ||
|
||
- name: Install | ||
uses: ./.github/common-actions/install | ||
|
||
- name: remove pre.json | ||
# we only remove .changeset/pre.json here | ||
# since we want to keep the changeset files introduced in beta/release-next or canary branch | ||
# once we merge it to canary / main, those files will be removed in version PR in canary | ||
# and converted to corresponding changelogs | ||
run: npx rimraf .changeset/pre.json | ||
|
||
- name: Commit and push changes | ||
run: | | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config user.name "github-actions[bot]" | ||
git add -A | ||
git commit -m "ci(changesets): exit pre-release mode" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Pre-release | ||
|
||
on: | ||
push: | ||
paths: | ||
- ".changeset/**" | ||
- "packages/**" | ||
branches: | ||
- "beta/release-next" | ||
- "canary" | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
prerelease: | ||
name: changesets pre-release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
id-token: write | ||
steps: | ||
- name: Checkout branch | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install | ||
uses: ./.github/common-actions/install | ||
|
||
- name: Check if pre.json exists | ||
id: check_if_pre_json_exists | ||
uses: andstor/[email protected] | ||
with: | ||
files: ".changeset/pre.json" | ||
|
||
- name: Get pre-release changesets | ||
id: get-pre-release-changesets | ||
uses: notiz-dev/github-action-json-property@release | ||
with: | ||
path: ".changeset/pre.json" | ||
prop_path: "changesets" | ||
|
||
- name: Create pre-release PR | ||
id: create-pre-release-pr | ||
if: "${{ steps.check_if_pre_json_exists.outputs.files_exists == 'true' && !startsWith(github.event.head_commit.message, 'ci(changesets): version packages') }}" | ||
uses: changesets/action@v1 | ||
with: | ||
version: pnpm run version | ||
title: "ci(changesets): :package: version packages" | ||
commit: "ci(changesets): version packages" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish to NPM | ||
id: publish-to-npm | ||
if: "${{ steps.check_if_pre_json_exists.outputs.files_exists == 'true' && contains(github.event.head_commit.message, 'ci(changesets): :package: version packages') }}" | ||
uses: changesets/action@v1 | ||
with: | ||
publish: pnpm run release | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters