release 0.2.2 #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: release | |
| # Tag a release to publish: git tag v0.3.0 && git push origin v0.3.0 | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write # needed to upload binaries to the GitHub Release | |
| id-token: write # needed for npm Trusted Publishing (OIDC) — no NPM_TOKEN required | |
| jobs: | |
| release: | |
| # bun cross-compiles every target from one Linux runner — no per-OS matrix. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| # Node is used to publish to npm and to run the helper scripts. | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: "https://registry.npmjs.org" | |
| # Trusted Publishing (OIDC) needs npm >= 11.5; setup-node's Node 20 ships npm 10. | |
| - name: Upgrade npm for Trusted Publishing | |
| run: npm install -g npm@latest | |
| - name: Derive version from tag | |
| id: ver | |
| run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Sync version across all packages | |
| run: node scripts/set-version.mjs "${{ steps.ver.outputs.version }}" | |
| - name: Build all platform binaries | |
| run: bun run build:binaries | |
| - name: Stage binaries into platform packages | |
| run: bun run stage:binaries | |
| # Publish platform packages FIRST so the main package's optionalDependencies resolve. | |
| - name: Publish platform packages | |
| run: | | |
| for dir in npm/*/; do | |
| echo "publishing $dir" | |
| (cd "$dir" && npm publish --access public) | |
| done | |
| - name: Publish main package | |
| run: npm publish --access public | |
| # Also attach the raw binaries to the GitHub Release (for the install-script channel). | |
| - name: Upload binaries to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/bin/* |