Skip to content

Commit a062cb2

Browse files
committed
Fix npm version invocation
1 parent 4ad599b commit a062cb2

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
# yamllint disable rule:line-length
33
name: "Publish to NPM"
44
on: # yamllint disable-line rule:truthy
5-
release:
6-
types:
7-
- "published"
5+
#release:
6+
#types:
7+
#- "published"
8+
# NOTE: this is temporary until I get the release process ironed out.
9+
pull_request:
10+
branches:
11+
- "*"
12+
813
jobs:
914
publish:
1015
name: Publish to NPM
@@ -22,7 +27,9 @@ jobs:
2227
VERSION=${GITHUB_REF_NAME#v}
2328
echo Version: $VERSION
2429
echo "VERSION=$VERSION" >> $GITHUB_ENV
25-
- run: "npm version ${VERSION}"
30+
# NOTE: the flag is necessary because otherwise `npm version <version>` attempts to
31+
# cut a git tag with that version, which fails because the git user isn't configured.
32+
- run: "npm version 1.0.2 --no-git-tag-version"
2633
- uses: JS-DevTools/npm-publish@v3
2734
with:
2835
token: ${{ secrets.NPM_TOKEN }}
@@ -45,13 +52,15 @@ jobs:
4552
- uses: bahmutov/npm-install@v1
4653
with:
4754
working-directory: ./js-dist
55+
# Set the version in package.json to match the tag
4856
- name: Write release version
4957
run: |
5058
VERSION=${GITHUB_REF_NAME#v}
5159
echo Version: $VERSION
5260
echo "VERSION=$VERSION" >> $GITHUB_ENV
53-
# Set the version in package.json to match the tag
54-
- run: "npm version ${VERSION}"
61+
# NOTE: the flag is necessary because otherwise `npm version <version>` attempts to
62+
# cut a git tag with that version, which fails because the git user isn't configured.
63+
- run: "npm version 1.0.2 --no-git-tag-version"
5564
working-directory: ./js-dist
5665
- uses: JS-DevTools/npm-publish@v3
5766
with:

0 commit comments

Comments
 (0)