chore: bump version to 0.3.1 #19
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*" | |
| concurrency: | |
| group: publish-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| preflight: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2 | |
| with: | |
| deno-version: v2.6.8 | |
| - name: Setup Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: 24 | |
| - name: Verify tag matches deno.json version | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| tag="${GITHUB_REF_NAME}" | |
| if [[ ! "${tag}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| echo "Tag '${tag}' is not a stable semantic version." | |
| exit 1 | |
| fi | |
| deno_version="$(deno eval 'console.log(JSON.parse(Deno.readTextFileSync("deno.json")).version)')" | |
| if [[ "${tag}" != "v${deno_version}" ]]; then | |
| echo "Tag '${tag}' does not match deno.json version '${deno_version}'." | |
| exit 1 | |
| fi | |
| - name: Run checks | |
| run: deno task check | |
| - name: Verify JSR package | |
| run: deno publish --dry-run | |
| - name: Build npm package | |
| run: deno task build:npm | |
| - name: Smoke test npm entry points | |
| run: >- | |
| node --input-type=module -e | |
| 'await Promise.all([ | |
| import("./npm/esm/mod.js"), | |
| import("./npm/esm/src/nondeterministic.js"), | |
| import("./npm/esm/src/perf.js") | |
| ])' | |
| - name: Verify npm package contents | |
| run: npm pack ./npm --dry-run | |
| publish-jsr: | |
| runs-on: ubuntu-latest | |
| needs: preflight | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2 | |
| with: | |
| deno-version: v2.6.8 | |
| - name: Publish to JSR | |
| run: deno publish | |
| publish-npm: | |
| runs-on: ubuntu-latest | |
| needs: publish-jsr | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2 | |
| with: | |
| deno-version: v2.6.8 | |
| - name: Setup Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: 24 | |
| 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 --provenance | |
| 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@11d5960a326750d5838078e36cf38b85af677262 # 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@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2 | |
| with: | |
| name: ${{ github.ref_name }} | |
| tag_name: ${{ github.ref_name }} | |
| body_path: RELEASE_NOTES.md |