Skip to content

Commit 9eecb8b

Browse files
committed
fix: add version detection for GitHub Packages publishing
The workflow now properly detects when semantic-release creates a new version and publishes to GitHub Packages as a secondary registry.
1 parent 6cd7819 commit 9eecb8b

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/semantic-release.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,26 @@ jobs:
4343
run: yarn build
4444

4545
- name: Run semantic-release
46+
id: semantic-release
4647
env:
4748
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4849
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4950
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
50-
run: npx semantic-release
51+
run: |
52+
# Capture the current version before release
53+
CURRENT_VERSION=$(node -p "require('./package.json').version")
54+
55+
# Run semantic-release
56+
npx semantic-release
57+
58+
# Check if version changed (indicating a release was made)
59+
NEW_VERSION=$(node -p "require('./package.json').version")
60+
if [ "$CURRENT_VERSION" != "$NEW_VERSION" ]; then
61+
echo "new-release-published=true" >> $GITHUB_OUTPUT
62+
echo "new-version=$NEW_VERSION" >> $GITHUB_OUTPUT
63+
else
64+
echo "new-release-published=false" >> $GITHUB_OUTPUT
65+
fi
5166
5267
- name: Generate SBOM
5368
if: steps.semantic-release.outputs.new-release-published == 'true'

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"description": "MCP server for interacting with the Wayback Machine without API keys",
55
"main": "dist/index.js",
66
"type": "module",
7-
"bin": "dist/index.js",
7+
"bin": {
8+
"mcp-wayback-machine": "dist/index.js"
9+
},
810
"scripts": {
911
"build": "tsc",
1012
"dev": "tsx watch src/index.ts",

0 commit comments

Comments
 (0)