diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index ccc8713..4c972ec 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 + 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 }} 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 +.