Skip to content

Commit

Permalink
Set NPM URL
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasOlla committed Oct 31, 2024
1 parent 9841817 commit 40a3baf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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 }}

0 comments on commit 40a3baf

Please sign in to comment.