chore: sigh, v0.3.5 #14
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 | |
| env: | |
| # Keep tests deterministic (see CI workflow). | |
| TZ: Europe/Bucharest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| - 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: Test | |
| run: deno test | |
| - name: Publish to JSR | |
| run: npx jsr publish | |
| github-release: | |
| runs-on: ubuntu-latest | |
| needs: [publish-jsr] | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - 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 |