Bump CLI to 0.2.2 with cleaner listen output #2
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 CLI | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'npm dist-tag (e.g. latest, next)' | |
| required: false | |
| default: 'latest' | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: 1.3.1 | |
| - name: Setup Node.js (for npm publish + provenance) | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Typecheck | |
| run: bun run typecheck | |
| - name: Test | |
| run: bun test | |
| - name: Verify tag matches package.json version | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: | | |
| TAG_VERSION="${GITHUB_REF_NAME#v}" | |
| PKG_VERSION="$(node -p "require('./package.json').version")" | |
| if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then | |
| echo "Tag version ($TAG_VERSION) does not match package.json version ($PKG_VERSION)" >&2 | |
| exit 1 | |
| fi | |
| - name: Build single-file binaries | |
| run: bun run build:binaries | |
| - name: Compute SHA256SUMS | |
| working-directory: dist/binaries | |
| run: shasum -a 256 messages-* > SHA256SUMS | |
| - name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create "$GITHUB_REF_NAME" \ | |
| --title "$GITHUB_REF_NAME" \ | |
| --generate-notes \ | |
| dist/binaries/messages-darwin-arm64 \ | |
| dist/binaries/messages-darwin-x64 \ | |
| dist/binaries/messages-linux-x64 \ | |
| dist/binaries/messages-linux-arm64 \ | |
| dist/binaries/messages-windows-x64.exe \ | |
| dist/binaries/SHA256SUMS | |
| - name: Build npm bundle | |
| run: bun run build | |
| - name: Publish to npm | |
| run: npm publish --access public --provenance --tag "${{ github.event.inputs.tag || 'latest' }}" | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |