From 40a3bafa78d191b036d66376c580081ebc64082d Mon Sep 17 00:00:00 2001 From: Mattias Olla Date: Thu, 31 Oct 2024 15:46:35 +0100 Subject: [PATCH] Set NPM URL --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c61a1a..8de0f34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,12 +44,14 @@ jobs: if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch steps: - uses: actions/checkout@v4 + with: + fetch-tags: true - name: Check if package version changed id: check_version run: | version="v$(cat package.json | jq -r '.version')" - if [ $(git tag -l "$version") ]; then + if [ $(git tag -l "v$version") ]; then echo "Tag $version already exists." else echo "version_tag=$version" >> "$GITHUB_OUTPUT" @@ -60,6 +62,7 @@ jobs: with: node-version-file: .nvmrc cache: npm + registry-url: "https://registry.npmjs.org" - name: Create GitHub release if: steps.check_version.outputs.version_tag @@ -72,6 +75,6 @@ jobs: if: steps.check_version.outputs.version_tag run: | npm ci - npm publish --access public + npm publish --provenance --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}