Skip to content

Commit 0709381

Browse files
Merge pull request #24 from chriscarrollsmith/22-automate-github-release-after-npm-publish-using-pr-message-as-version-notes
Automated Github release workflow
2 parents 5906ba3 + feefa27 commit 0709381

File tree

4 files changed

+49
-7
lines changed

4 files changed

+49
-7
lines changed

.github/workflows/npm-publish.yml

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,54 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0 # Fetch all history for PR message extraction
27+
2528
- uses: actions/setup-node@v4
2629
with:
2730
node-version: 'latest'
31+
32+
- name: Get PR Message
33+
id: pr_message
34+
run: |
35+
PR_NUMBER=$(git log -1 --pretty=%B | grep -oP '#\K\d+' || echo "")
36+
if [ ! -z "$PR_NUMBER" ]; then
37+
PR_MESSAGE=$(gh pr view $PR_NUMBER --json body -q .body || echo "")
38+
echo "message<<EOF" >> $GITHUB_OUTPUT
39+
echo "$PR_MESSAGE" >> $GITHUB_OUTPUT
40+
echo "EOF" >> $GITHUB_OUTPUT
41+
else
42+
echo "message=No PR message found" >> $GITHUB_OUTPUT
43+
fi
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
2847
- run: npm ci
2948
- run: npm install -g tsx
30-
- run: npm run build # Add build step here too
31-
- uses: JS-DevTools/npm-publish@v3
49+
- run: npm run build
50+
51+
- name: Publish to NPM
52+
id: publish
53+
uses: JS-DevTools/npm-publish@v3
54+
with:
55+
token: ${{ secrets.NPM_TOKEN }}
56+
57+
- name: Get package version
58+
if: steps.publish.outputs.type != 'none'
59+
id: package_version
60+
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
61+
62+
- name: Create GitHub Release
63+
if: steps.publish.outputs.type != 'none'
64+
uses: actions/create-release@v1
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3267
with:
33-
token: ${{ secrets.NPM_TOKEN }}
68+
tag_name: v${{ steps.package_version.outputs.version }}
69+
release_name: Release v${{ steps.package_version.outputs.version }}
70+
body: |
71+
${{ steps.pr_message.outputs.message }}
72+
73+
Package published to npm: ${{ steps.publish.outputs.version }}
74+
draft: false
75+
prerelease: false

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ListToolsRequestSchema, CallToolRequestSchema } from "@modelcontextprot
1010
const server = new Server(
1111
{
1212
name: "task-manager-server",
13-
version: "1.0.8"
13+
version: "1.0.9"
1414
},
1515
{
1616
capabilities: {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "taskqueue-mcp",
3-
"version": "1.0.8",
3+
"version": "1.0.9",
44
"description": "Task Queue MCP Server",
55
"author": "Christopher C. Smith ([email protected])",
66
"main": "dist/index.js",

0 commit comments

Comments
 (0)