From bcba1af2fa8b326dfe06d07b67b4bb345d371c8b Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 27 Mar 2024 19:37:03 -0400 Subject: [PATCH] chore: fix publish (#133) --- .github/workflows/ci.yml | 13 +++---------- scripts/update_deno_json_version.ts | 16 ---------------- 2 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 scripts/update_deno_json_version.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d373075..212c737 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,13 +47,6 @@ jobs: - name: Test run: deno task test - - name: Get tag version - if: contains(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags/') - id: get_tag_version - run: echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> "$GITHUB_OUTPUT" - - - name: Publish - if: contains(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags/') - run: | - deno run -A ./scripts/update_deno_json_version.ts ${{steps.get_tag_version.outputs.TAG_VERSION}} - deno publish + - name: Publish on tag + if: contains(matrix.os, 'ubuntu') + run: deno run -A jsr:@david/publish-on-tag@0.1.2 --allow-dirty diff --git a/scripts/update_deno_json_version.ts b/scripts/update_deno_json_version.ts deleted file mode 100644 index b3f2153..0000000 --- a/scripts/update_deno_json_version.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018-2024 the Deno authors. MIT license. - -import * as path from "@std/path"; - -// temporary until https://github.com/denoland/deno/issues/22663 is implemented - -const version = Deno.args[0]; -if (version == null || version.length === 0) { - throw new Error("Please provide a version."); -} - -const rootDir = path.dirname(import.meta.dirname!); -const denoJsonPath = path.join(rootDir, "/deno.json"); -const data = JSON.parse(Deno.readTextFileSync(denoJsonPath)); -data.version = version; -Deno.writeTextFileSync(denoJsonPath, JSON.stringify(data, undefined, 2) + "\n");