File tree Expand file tree Collapse file tree 8 files changed +371
-278
lines changed
Expand file tree Collapse file tree 8 files changed +371
-278
lines changed Original file line number Diff line number Diff line change 6666 name : ${{ matrix.slug }}
6767 path : binaries/${{ matrix.slug }}
6868
69- - name : Setup npm auth
70- if : startsWith(github.ref, 'refs/tags/v')
71- run : |
72- echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
73-
7469 - name : Smoke test platform binary
7570 shell : bash
7671 run : |
7772 chmod +x binaries/${{ matrix.slug }}/codemachine* || true
7873 binaries/${{ matrix.slug }}/codemachine --version
79-
80- - name : Publish platform package to npm
81- if : startsWith(github.ref, 'refs/tags/v')
82- shell : bash
83- run : |
84- cd binaries/${{ matrix.slug }}
85- npm publish --access public --tag latest
Original file line number Diff line number Diff line change 1+ name : publish
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ tag :
7+ description : " npm dist-tag (default: latest)"
8+ required : false
9+ type : string
10+ dry_run :
11+ description : " Dry run (no publish)"
12+ required : false
13+ default : false
14+ type : boolean
15+ push :
16+ tags :
17+ - ' v*'
18+
19+ concurrency : ${{ github.workflow }}-${{ github.ref }}
20+
21+ permissions :
22+ contents : write
23+ packages : write
24+
25+ jobs :
26+ publish :
27+ runs-on : ubuntu-latest
28+ steps :
29+ - uses : actions/checkout@v4
30+ with :
31+ fetch-depth : 0
32+
33+ - name : Setup Bun
34+ uses : oven-sh/setup-bun@v1
35+ with :
36+ bun-version : 1.3.0
37+
38+ - name : Install dependencies
39+ run : bun install --frozen-lockfile
40+
41+ - name : Publish packages
42+ env :
43+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
44+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
45+ NPM_TAG : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || '' }}
46+ DRY_RUN : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run || '' }}
47+ run : |
48+ TAG=${NPM_TAG:-latest}
49+ CMD="bun scripts/publish.ts --tag ${TAG}"
50+ if [ "${DRY_RUN}" = "true" ]; then
51+ CMD="${CMD} --dry-run"
52+ fi
53+ echo "Running: ${CMD}"
54+ ${CMD}
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ package-lock.json
1313.env
1414.env.example
1515.npmrc
16+ .npmrc.publish
1617
1718# Ignore folders starting with .tmp
1819.tmp *
@@ -23,4 +24,4 @@ package-lock.json
2324.codemachine /template.json
2425
2526# MkDocs build output
26- site /
27+ site /
Original file line number Diff line number Diff line change 3939 "_comment_release" : " Release: Publishing and validation" ,
4040 "prepare" : " husky install" ,
4141 "validate" : " bun scripts/validate.mjs" ,
42- "release" : " bun scripts/publish.mjs --tag latest" ,
43- "publish:platform " : " bun scripts/publish-platform.mjs "
42+ "release" : " bun scripts/publish.ts --tag latest" ,
43+ "publish:all " : " bun scripts/publish.ts --tag latest --dry-run "
4444 },
4545 "dependencies" : {
4646 "1.3.0" : " ^1.3.0" ,
You can’t perform that action at this time.
0 commit comments