From bf1a75c6ab60f72200ab71001bca78b033d82bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Nilsved?= Date: Sun, 30 Mar 2025 20:55:38 +0200 Subject: [PATCH 1/3] Match workflow to latest from dnt docs https://github.com/denoland/dnt?tab=readme-ov-file#github-actions---npm-publish-on-tag --- .github/workflows/npm-publish.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index ccc8713..6df8ebd 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -11,26 +11,26 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Get tag version - if: startsWith(github.ref, 'refs/tags/') - id: get_tag_version - run: echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT - - name: Setup Deno uses: denoland/setup-deno@v2 with: deno-version: v2.x # Run with latest stable Deno. + - name: Get tag version + if: startsWith(github.ref, 'refs/tags/') + id: get_tag_version + run: echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT + - name: Setup Node uses: actions/setup-node@v3 with: - node-version: 22 - registry-url: "https://registry.npmjs.org" + node-version: '22.x' + registry-url: 'https://registry.npmjs.org' - - name: Build package + - name: npm build run: deno run -A ./scripts/build_npm.ts ${{steps.get_tag_version.outputs.TAG_VERSION}} - - name: Publish package + - name: npm publish if: startsWith(github.ref, 'refs/tags/') env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 81408c434efdd20820f2d49852b7dabb34077af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Nilsved?= Date: Mon, 31 Mar 2025 15:16:56 +0200 Subject: [PATCH 2/3] Format yml --- .github/workflows/npm-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 6df8ebd..4c972ec 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -24,8 +24,8 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: '22.x' - registry-url: 'https://registry.npmjs.org' + node-version: "22.x" + registry-url: "https://registry.npmjs.org" - name: npm build run: deno run -A ./scripts/build_npm.ts ${{steps.get_tag_version.outputs.TAG_VERSION}} From eda20ad658c64d6077b9ef6f0e412d6f9004fc66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Nilsved?= Date: Mon, 31 Mar 2025 15:18:34 +0200 Subject: [PATCH 3/3] Document NPM_TOKEN config for publishing --- DEVELOPMENT.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index a80f0df..0b341a6 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -44,3 +44,9 @@ package using a local path: ```sh npm install path/to/com-plain-date/npm ``` + +## Troubleshooting + +If publishing to npm gives 404 errors, check that `NPM_TOKEN` is not expired at + and set properly at +.