-
Notifications
You must be signed in to change notification settings - Fork 59
chore: add auto-release script #2086
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
base: main
Are you sure you want to change the base?
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 | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,27 @@ | ||||||||||||||||||||
| name: Release packages | ||||||||||||||||||||
|
|
||||||||||||||||||||
| on: | ||||||||||||||||||||
| release: | ||||||||||||||||||||
| types: [published] | ||||||||||||||||||||
|
|
||||||||||||||||||||
| jobs: | ||||||||||||||||||||
| release: | ||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| permissions: | ||||||||||||||||||||
| contents: 'write' | ||||||||||||||||||||
| id-token: 'write' | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - uses: actions/checkout@v3 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| submodules: true | ||||||||||||||||||||
| - uses: actions/setup-node@v3 | ||||||||||||||||||||
|
Comment on lines
+14
to
+17
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. Pin checkout to the release tag. On release events, explicitly checking out the tag avoids any mismatch with default-branch HEAD. - - uses: actions/checkout@v3
- with:
- submodules: true
+ - uses: actions/checkout@v4
+ with:
+ submodules: true
+ ref: ${{ github.event.release.tag_name }}📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.7)14-14: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 17-17: the runner of "actions/setup-node@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🤖 Prompt for AI Agents |
||||||||||||||||||||
| with: | ||||||||||||||||||||
| node-version: '20.10.0' | ||||||||||||||||||||
| registry-url: 'https://registry.npmjs.org' | ||||||||||||||||||||
| - name: Install dependencies and publish | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| npm ci | ||||||||||||||||||||
| npm run build | ||||||||||||||||||||
| npm publish --provenance --access public | ||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Confirm expected tag format for cdn_deploy.js.
You’re now passing github.ref_name (e.g., “v1.2.3”). If the script expects “1.2.3” (no “v”), it will mispublish.
🏁 Script executed:
Length of output: 1260
🏁 Script executed:
Length of output: 160
🏁 Script executed:
Length of output: 5580
Confirm expected tag format for cdn_deploy.js.
cdn_deploy.js uses config.tag verbatim — getVersions(fullVersion) does not strip a leading "v" and will produce versions like "v1", "v1.2", "v1.2.3". Passing ${{ github.ref_name }} (e.g. "v1.2.3") will embed the leading "v" in uploaded filenames.
Either pass the tag without the leading "v" from the workflow or normalize/remove a leading "v" in scripts/cdn_deploy.js before calling getVersions.
Locations: scripts/cdn_deploy.js — getVersions (lines 118–121) and invocation at line 58; .github/workflows/publish-cdn.yml — line 28.
🤖 Prompt for AI Agents