update version #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: Publish to JSR | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| - name: Verify tag matches deno.json version | |
| if: github.event_name == 'push' | |
| run: | | |
| TAG_VERSION="${GITHUB_REF_NAME#v}" | |
| PKG_VERSION=$(deno eval "console.log(JSON.parse(Deno.readTextFileSync('deno.json')).version)") | |
| if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then | |
| echo "Tag version ($TAG_VERSION) does not match deno.json version ($PKG_VERSION)" | |
| exit 1 | |
| fi | |
| - name: Format check | |
| run: deno fmt --check | |
| - name: Lint | |
| run: deno lint | |
| - name: Type check | |
| run: deno task check | |
| - name: Test | |
| run: deno task test | |
| - name: Publish to JSR | |
| run: deno publish |