From c02bdc18c365f14c50e2885dcd15906893361260 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Tue, 12 Nov 2024 14:29:17 -0500 Subject: [PATCH 1/2] chore(ci): Publish to JSR on tag --- .github/workflows/deno_tests.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/deno_tests.yml b/.github/workflows/deno_tests.yml index b5d8760d..14fd80f7 100644 --- a/.github/workflows/deno_tests.yml +++ b/.github/workflows/deno_tests.yml @@ -95,6 +95,25 @@ jobs: deno-version: v2.x - run: deno publish --dry-run + publish: + runs-on: ubuntu-latest + needs: [test, publish-dry-run] + if: github.ref_type == 'tag' + permissions: + contents: read + id-token: write + attestations: write + steps: + - uses: actions/checkout@v4 + - name: Check tag matches ${{ github.ref_name }} + run: jq -e ".version==\"${TAG#v}\"" deno.json + env: + TAG: ${{ github.ref_name }} + - uses: denoland/setup-deno@v2 + with: + deno-version: v2.x + - run: deno publish + deploy: needs: [build] runs-on: ubuntu-latest From b9871f685924736d198d0fde4f5d6a372a9b08ce Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Tue, 12 Nov 2024 14:54:53 -0500 Subject: [PATCH 2/2] chore(ci): Enforce tag == version and does not start with v --- .github/workflows/deno_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deno_tests.yml b/.github/workflows/deno_tests.yml index 14fd80f7..206679f4 100644 --- a/.github/workflows/deno_tests.yml +++ b/.github/workflows/deno_tests.yml @@ -106,7 +106,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Check tag matches ${{ github.ref_name }} - run: jq -e ".version==\"${TAG#v}\"" deno.json + run: jq -e ".version[:1] != \"v\" and .version==\"$TAG\"" deno.json env: TAG: ${{ github.ref_name }} - uses: denoland/setup-deno@v2