chore: bump version to 0.2.8 #17
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-jsr: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Publish to JSR | |
| run: npx jsr publish | |
| publish-npm: | |
| runs-on: ubuntu-latest | |
| needs: publish-jsr | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Build npm package | |
| run: deno task build:npm | |
| - name: Publish to npm | |
| run: npm publish ./npm --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| github-release: | |
| runs-on: ubuntu-latest | |
| needs: [publish-jsr, publish-npm] | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Verify tag matches deno.json version | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| tag="${GITHUB_REF_NAME}" | |
| version="${tag#v}" | |
| deno_version="$(node -p "require('./deno.json').version")" | |
| if [[ "${deno_version}" != "${version}" ]]; then | |
| echo "Tag '${tag}' does not match deno.json version '${deno_version}'." | |
| exit 1 | |
| fi | |
| - name: Generate changelog | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| tag="${GITHUB_REF_NAME}" | |
| prev_tag="$( | |
| git tag --list "v*" --sort=-version:refname \ | |
| | grep -v "^${tag}$" \ | |
| | head -n 1 || true | |
| )" | |
| { | |
| echo "# ${tag}" | |
| echo | |
| if [[ -n "${prev_tag}" ]]; then | |
| echo "Changes since ${prev_tag}:" | |
| echo | |
| git log --no-merges --pretty=format:"- %s (%h)" "${prev_tag}..${tag}" | |
| else | |
| echo "Changes:" | |
| echo | |
| git log --no-merges --pretty=format:"- %s (%h)" "${tag}" | |
| fi | |
| echo | |
| } > RELEASE_NOTES.md | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{ github.ref_name }} | |
| tag_name: ${{ github.ref_name }} | |
| body_path: RELEASE_NOTES.md |