File tree Expand file tree Collapse file tree 2 files changed +72
-2
lines changed
Expand file tree Collapse file tree 2 files changed +72
-2
lines changed Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*.*.*'
7+ workflow_dispatch :
8+
9+ permissions :
10+ contents : write
11+
12+ jobs :
13+ publish :
14+ runs-on : ubuntu-latest
15+ steps :
16+ - name : Checkout repository
17+ uses : actions/checkout@v4
18+ with :
19+ fetch-depth : 0
20+
21+ - name : Use Node.js 20
22+ uses : actions/setup-node@v4
23+ with :
24+ node-version : 20
25+
26+ - name : Install dependencies
27+ run : npm ci
28+
29+ - name : Lint
30+ run : npm run lint
31+
32+ - name : Test
33+ run : npm run test
34+
35+ - name : Build
36+ run : npm run build
37+
38+ - name : Bundle
39+ run : npm run bundle
40+
41+ - name : Ensure bundled dist is committed
42+ run : |
43+ if ! git diff --quiet -- dist; then
44+ echo '::error::Bundling modified files under dist/. Run npm run bundle locally and commit the results before tagging.'
45+ git status --short dist
46+ exit 1
47+ fi
48+
49+ - name : Update major tag
50+ if : startsWith(github.ref, 'refs/tags/')
51+ env :
52+ TAG_NAME : ${{ github.ref_name }}
53+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
54+ run : |
55+ git config user.name "github-actions[bot]"
56+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
57+ git tag -f v1 "$TAG_NAME"
58+ git push origin v1 --force
59+
60+ - name : Publish GitHub release
61+ if : startsWith(github.ref, 'refs/tags/')
62+ env :
63+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
64+ TAG_NAME : ${{ github.ref_name }}
65+ run : |
66+ if gh release view "$TAG_NAME" >/dev/null 2>&1; then
67+ echo "Release $TAG_NAME already exists; skipping creation."
68+ else
69+ gh release create "$TAG_NAME" --title "$TAG_NAME" --notes "See CHANGELOG.md for details." --latest
70+ fi
Original file line number Diff line number Diff line change @@ -207,11 +207,11 @@ Use Context7 MCP for up to date documentation.
207207
208208## 8) Build, bundle, release
209209
210- 32 . [ ] ** Bundle with ncc and commit ` dist/ ` **
210+ 32 . [x ] ** Bundle with ncc and commit ` dist/ ` **
211211 ` ncc build src/index.ts -o dist ` .
212212 Verify: ` dist/index.js ` runs. No dynamic requires.
213213
214- 33 . [ ] ** Release workflow**
214+ 33 . [x ] ** Release workflow**
215215 Tag ` v0.1.0 ` . Maintain moving ` v1 ` .
216216 Verify: Tags and Marketplace listing live.
217217
You can’t perform that action at this time.
0 commit comments