Skip to content

Commit

Permalink
Merge pull request #165 from authzed/fix-invocation-of-node-version
Browse files Browse the repository at this point in the history
Fix npm version invocation
  • Loading branch information
tstirrat15 authored Oct 3, 2024
2 parents 4ad599b + ddd7cfb commit afbf487
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on: # yamllint disable-line rule:truthy
release:
types:
- "published"

jobs:
publish:
name: Publish to NPM
Expand All @@ -15,14 +16,15 @@ jobs:
with:
node-version: 18
- uses: bahmutov/npm-install@v1
- run: yarn test
# Set the version in package.json to match the tag
- name: Write release version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
- run: "npm version ${VERSION}"
# NOTE: the flag is necessary because otherwise `npm version <version>` attempts to
# cut a git tag with that version, which fails because the git user isn't configured.
- run: "npm version ${VERSION} --no-git-tag-version"
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
Expand All @@ -45,13 +47,15 @@ jobs:
- uses: bahmutov/npm-install@v1
with:
working-directory: ./js-dist
# Set the version in package.json to match the tag
- name: Write release version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
# Set the version in package.json to match the tag
- run: "npm version ${VERSION}"
# NOTE: the flag is necessary because otherwise `npm version <version>` attempts to
# cut a git tag with that version, which fails because the git user isn't configured.
- run: "npm version ${VERSION} --no-git-tag-version"
working-directory: ./js-dist
- uses: JS-DevTools/npm-publish@v3
with:
Expand Down

0 comments on commit afbf487

Please sign in to comment.