-
Notifications
You must be signed in to change notification settings - Fork 1
fix: adopt caido/action-release for immutable releases #7
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,22 +1,32 @@ | ||||||||||||||
| name: Release | ||||||||||||||
|
|
||||||||||||||
| on: | ||||||||||||||
| push: | ||||||||||||||
| tags: | ||||||||||||||
| - 'v*' | ||||||||||||||
| workflow_dispatch: | ||||||||||||||
|
|
||||||||||||||
| env: | ||||||||||||||
| NODE_VERSION: 20 | ||||||||||||||
|
|
||||||||||||||
| jobs: | ||||||||||||||
| release: | ||||||||||||||
| name: Release | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| permissions: | ||||||||||||||
| contents: write | ||||||||||||||
| steps: | ||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||
| - name: Verify main branch | ||||||||||||||
| run: | | ||||||||||||||
| if [[ "${{ github.ref_name }}" != "main" ]]; then | ||||||||||||||
| echo "Release can only be done on the main branch." | ||||||||||||||
| exit 1 | ||||||||||||||
| fi | ||||||||||||||
|
|
||||||||||||||
| - name: Checkout project | ||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||
|
|
||||||||||||||
| - name: Install Node.js | ||||||||||||||
| - name: Setup Node.js | ||||||||||||||
| uses: actions/setup-node@v4 | ||||||||||||||
| with: | ||||||||||||||
| node-version: 20 | ||||||||||||||
| node-version: ${{ env.NODE_VERSION }} | ||||||||||||||
|
|
||||||||||||||
| - name: Install dependencies | ||||||||||||||
| run: npm install | ||||||||||||||
|
|
@@ -25,14 +35,28 @@ jobs: | |||||||||||||
| run: npm run build | ||||||||||||||
|
|
||||||||||||||
| - name: Sign plugin | ||||||||||||||
| working-directory: dist | ||||||||||||||
| run: | | ||||||||||||||
| if [[ -z "${{ secrets.PRIVATE_KEY }}" ]]; then | ||||||||||||||
| echo "Set an ed25519 key as PRIVATE_KEY in GitHub Action secret to sign." | ||||||||||||||
| exit 1 | ||||||||||||||
| fi | ||||||||||||||
| echo "${{ secrets.PRIVATE_KEY }}" > private_key.pem | ||||||||||||||
| openssl pkeyutl -sign -inkey private_key.pem -out plugin_package.zip.sig -rawin -in plugin_package.zip | ||||||||||||||
| rm private_key.pem | ||||||||||||||
|
Comment on lines
+45
to
+46
|
||||||||||||||
| openssl pkeyutl -sign -inkey private_key.pem -out plugin_package.zip.sig -rawin -in plugin_package.zip | |
| rm private_key.pem | |
| trap 'rm -f private_key.pem' EXIT | |
| openssl pkeyutl -sign -inkey private_key.pem -out plugin_package.zip.sig -rawin -in plugin_package.zip |
Copilot
AI
Feb 10, 2026
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.
jq -r .version will output the literal string null (exit code 0) if the manifest is missing a version field, which would then be used as the Git tag. Add validation that VERSION is non-empty and not null (and optionally matches the expected semver format) before writing it to $GITHUB_OUTPUT.
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| if [ -z "$VERSION" ] || [ "$VERSION" = "null" ]; then | |
| echo "Error: manifest.json is missing a valid 'version' field." | |
| exit 1 | |
| fi | |
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" |
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.
The workflow uses
npm install/npm run buildeven though the repo is bun-first (bun.lock + README/.agents docs). This means the release build can ignore the lockfile and produce non-reproducible artifacts. Consider setting up bun in this workflow and usingbun install --frozen-lockfile+bun run build(orbun run packageif that's the intended release artifact).