Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
id-token: write
steps:
- uses: actions/checkout@v4

Expand All @@ -27,7 +28,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24
registry-url: https://registry.npmjs.org

- name: Install Dependencies
Expand All @@ -49,8 +50,28 @@ jobs:
fi
echo "Version OK: $cli_version"

- name: Verify Tag Matches package.json
if: startsWith(github.ref, 'refs/tags/v')
run: |
tag_version="${GITHUB_REF_NAME#v}"
pkg_version="$(node -p "require('./package.json').version")"
if [ "$tag_version" != "$pkg_version" ]; then
echo "Tag/package mismatch: tag=$tag_version package=$pkg_version"
exit 1
fi
echo "Tag matches package version: $pkg_version"

- name: Pack npm artifact
run: npm pack --pack-destination .

- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
Comment on lines +67 to +69
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Create GitHub release only after npm publish succeeds

On tag pushes, this step executes before Publish To npm, so a failing npm publish (for example, an expired NPM_TOKEN or an already-published version) still leaves behind a GitHub Release and attached tarball for a version that is not actually available on npm. Reordering release creation to run after successful publish (or explicitly gating it on publish success) avoids publishing misleading release artifacts.

Useful? React with 👍 / 👎.

with:
generate_release_notes: true
files: |
*.tgz

- name: Publish To npm
if: ${{ github.event_name == 'push' || github.event.inputs.publish == 'true' }}
run: npm publish --cache /tmp/npm-cache
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"name": "bluebubbles-cli",
"version": "0.1.6",
"description": "Curated BlueBubbles CLI organized around terminal-friendly resources",
"repository": {
"type": "git",
"url": "https://github.com/anmho/bluebubbles-cli"
},
"type": "module",
"bin": {
"bluebubbles": "dist/index.js"
Expand Down
Loading