44 push :
55 tags :
66 - ' v*'
7+ pull_request :
8+ branches :
9+ - main
10+ workflow_dispatch :
11+ inputs :
12+ dry-run :
13+ description : Validate build and npm publish without uploading
14+ type : boolean
15+ default : true
716
817permissions :
918 contents : write
19+ id-token : write
20+
21+ env :
22+ DRY_RUN : ${{ !(startsWith(github.ref, 'refs/tags/') || inputs.dry-run == 'false') }}
1023
1124jobs :
1225 build :
1326 runs-on : ubuntu-latest
1427
1528 steps :
16- - uses : actions/checkout@v4
29+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1730
18- - uses : oven-sh/setup-bun@v2
31+ - uses : oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2.1.2
1932 with :
2033 bun-version : latest
2134
5063 sha256sum plannotator-win32-x64.exe > plannotator-win32-x64.exe.sha256
5164
5265 - name : Upload artifacts
53- uses : actions/upload-artifact@v4
66+ uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
5467 with :
5568 name : binaries
5669 path : |
@@ -64,10 +77,10 @@ jobs:
6477 contents : write
6578
6679 steps :
67- - uses : actions/checkout@v4
80+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6881
6982 - name : Download artifacts
70- uses : actions/download-artifact@v4
83+ uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
7184 with :
7285 name : binaries
7386 path : artifacts
7689 run : ls -la artifacts/
7790
7891 - name : Create GitHub Release
79- uses : softprops/action-gh-release@v2
92+ if : startsWith(github.ref, 'refs/tags/')
93+ uses : softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
8094 with :
8195 files : artifacts/*
8296 generate_release_notes : true
8397 draft : false
8498 prerelease : ${{ contains(github.ref, '-') }}
99+
100+ npm-publish :
101+ needs : build
102+ runs-on : ubuntu-latest
103+ permissions :
104+ contents : read
105+ id-token : write
106+ env :
107+ PUBLISH_FLAGS : ${{ env.DRY_RUN == 'true' && '--dry-run' || '' }}
108+ steps :
109+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
110+
111+ - uses : oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2.1.2
112+ with :
113+ bun-version : latest
114+
115+ - name : Install dependencies
116+ run : bun install
117+
118+ - name : Build packages
119+ run : |
120+ bun run build:review
121+ bun run build:hook
122+ bun run build:opencode
123+ bun run build:pi
124+
125+ - name : Publish @plannotator/opencode
126+ run : bun publish --access public --provenance $PUBLISH_FLAGS
127+ working-directory : apps/opencode-plugin
128+ env :
129+ NPM_CONFIG_TOKEN : ${{ secrets.NPM_TOKEN }}
130+
131+ - name : Publish @plannotator/pi-extension
132+ run : bun publish --access public --provenance $PUBLISH_FLAGS
133+ working-directory : apps/pi-extension
134+ env :
135+ NPM_CONFIG_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments