-
Notifications
You must be signed in to change notification settings - Fork 11
ci: simplify release workflow #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,67 +1,47 @@ | ||
| name: Release Full | ||
| # This action will publish the package to npm and create a GitHub release. | ||
| name: Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| type: choice | ||
| description: 'Release Npm Tag' | ||
| required: true | ||
| default: 'nightly' | ||
| options: | ||
| - alpha | ||
| - beta | ||
| - canary | ||
| - latest | ||
| - nightly | ||
| - rc | ||
| # Run `npm run bump` to bump the version and create a git tag. | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
|
|
||
| dry_run: | ||
| type: boolean | ||
| description: 'DryRun release' | ||
| required: true | ||
| default: false | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write | ||
| # To publish packages with provenance | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| release: | ||
| name: Release | ||
| environment: npm | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| environment: npm | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
|
|
||
| - name: Install Pnpm | ||
| run: npm i -g corepack@latest --force && corepack enable | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 24.14.1 | ||
| cache: 'pnpm' | ||
| node-version: 24 | ||
chenjiahan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Update npm to the latest version to enable OIDC | ||
| - name: Update npm | ||
| - name: Setup Package Managers | ||
| run: | | ||
| npm install -g npm@latest | ||
| npm --version | ||
| npm install -g corepack@latest --force | ||
| corepack enable | ||
|
|
||
| - name: Install Dependencies | ||
| run: pnpm install | ||
chenjiahan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
chenjiahan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: Run Test | ||
| run: pnpm run test | ||
|
|
||
| - name: Dry run release to npm | ||
| if: inputs.dry_run | ||
| run: node scripts/release.js --dry-run --tag ${{ inputs.tag }} | ||
| - name: Publish | ||
| uses: JS-DevTools/npm-publish@v4 | ||
| with: | ||
| token: empty | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The publish step passes a literal placeholder token ( Useful? React with 👍 / 👎.
chenjiahan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Release to npm | ||
| if: ${{ !inputs.dry_run }} | ||
| run: node scripts/release.js --tag ${{ inputs.tag }} | ||
| - name: Create GitHub Release | ||
| uses: ncipollo/release-action@v1 | ||
| with: | ||
| # TODO: remove beta tag before release stable | ||
| tag: beta | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The release job is triggered by pushed tags ( Useful? React with 👍 / 👎.
chenjiahan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| generateReleaseNotes: 'true' | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.