Skip to content

Commit eacbe55

Browse files
feat(ci): integrate release notes generation with npm publish workflow
- Add release notes generation job that triggers before package publication - Ensure release notes are created automatically when releases are published - Maintain existing build and publish functionality - Add proper job dependencies for sequential execution - Include timing coordination for workflow completion
1 parent 651fb5a commit eacbe55

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

.github/workflows/npm-publish.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,33 @@ on:
88
types: [created]
99

1010
jobs:
11+
generate-release-notes:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: read
16+
steps:
17+
- name: Trigger release notes generation
18+
uses: actions/github-script@v7
19+
with:
20+
github-token: ${{ secrets.GITHUB_TOKEN }}
21+
script: |
22+
// Trigger the release notes workflow
23+
await github.rest.actions.createWorkflowDispatch({
24+
owner: context.repo.owner,
25+
repo: context.repo.repo,
26+
workflow_id: 'release-notes.yml',
27+
ref: 'main',
28+
inputs: {
29+
tag_name: '${{ github.event.release.tag_name }}',
30+
target_commitish: '${{ github.event.release.target_commitish }}'
31+
}
32+
});
33+
console.log('Release notes generation triggered');
34+
35+
// Wait a bit for the workflow to complete
36+
await new Promise(resolve => setTimeout(resolve, 5000));
37+
1138
build:
1239
runs-on: ubuntu-latest
1340
steps:
@@ -22,7 +49,7 @@ jobs:
2249
- run: npm test
2350

2451
publish-npm:
25-
needs: build
52+
needs: [generate-release-notes, build]
2653
runs-on: ubuntu-latest
2754
steps:
2855
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)