Repository navigation
v0.3.1 — dependency updates #3
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: Publish | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # needed for GitHub Release creation | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Type check | |
| run: bunx tsc --noEmit | |
| - name: Verify version matches tag | |
| run: | | |
| TAG=${GITHUB_REF#refs/tags/v} | |
| PKG=$(node -p "require('./package.json').version") | |
| if [ "$TAG" != "$PKG" ]; then | |
| echo "Tag v$TAG does not match package.json version $PKG" | |
| exit 1 | |
| fi | |
| echo "Version verified: $PKG" | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| registry-url: https://registry.npmjs.org | |
| - name: Publish to npm | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Extract changelog for this version | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| awk "/^## \[${VERSION}\]/{found=1; next} found && /^## \[/{exit} found{print}" CHANGELOG.md > release_notes.md | |
| if [ ! -s release_notes.md ]; then | |
| echo "No changelog entry found for v${VERSION}." > release_notes.md | |
| fi | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| body_path: release_notes.md |