Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix npm version invocation #165

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading