diff --git a/.github/workflows/publish-jsr.yml b/.github/workflows/publish-jsr.yml deleted file mode 100644 index 2777832..0000000 --- a/.github/workflows/publish-jsr.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Publish on JSR -on: - push: - branches: - - main - -jobs: - publish: - runs-on: ubuntu-latest - - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@v4 - - name: Publish package - run: npx jsr publish - - name: Setup Deno Environment - uses: denoland/setup-deno@v2 - with: - deno-version: v2.x - - name: Test that things are working - run: deno task run - - name: Publish to JSR - run: deno publish diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4c3b208 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release Automation (triggered on tag) + +on: + push: + tags: v[0-9]+.[0-9]+.[0-9]+ + +jobs: + test-deno: + runs-on: ubuntu-latest + name: Test the Deno CLI + steps: + - uses: actions/checkout@v2 + - name: Setup Deno + uses: denolib/setup-deno@v2 + with: + deno-version: v2.x + - name: Run the CLI to verify it's working + run: deno task run + publish-jsr: + name: Publish to JSR + runs-on: ubuntu-latest + needs: test-deno + steps: + - uses: actions/checkout@v2 + - name: Setup Deno + uses: denolib/setup-deno@v2 + with: + deno-version: v2.x + - name: Update version in `deno.json` + run: | + tag=${GITHUB_REF#refs/tags/} + version=${tag#v} + jq --arg version "$version" '.version = $version' deno.json > tmp.$$.json + mv tmp.$$.json deno.json + - name: Publish to JSR + run: deno publish --allow-dirty