From a062cb2093788a4747fc5b921af40d5329e42a34 Mon Sep 17 00:00:00 2001 From: Tanner Stirrat Date: Thu, 3 Oct 2024 12:26:52 -0600 Subject: [PATCH 1/2] Fix npm version invocation --- .github/workflows/publish.yaml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index ca835a6..1486574 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -2,9 +2,14 @@ # yamllint disable rule:line-length name: "Publish to NPM" on: # yamllint disable-line rule:truthy - release: - types: - - "published" + #release: + #types: + #- "published" + # NOTE: this is temporary until I get the release process ironed out. + pull_request: + branches: + - "*" + jobs: publish: name: Publish to NPM @@ -22,7 +27,9 @@ jobs: 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 ` attempts to + # cut a git tag with that version, which fails because the git user isn't configured. + - run: "npm version 1.0.2 --no-git-tag-version" - uses: JS-DevTools/npm-publish@v3 with: token: ${{ secrets.NPM_TOKEN }} @@ -45,13 +52,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 ` attempts to + # cut a git tag with that version, which fails because the git user isn't configured. + - run: "npm version 1.0.2 --no-git-tag-version" working-directory: ./js-dist - uses: JS-DevTools/npm-publish@v3 with: From ddd7cfba624b74d396dcba19539e2747aaadc98c Mon Sep 17 00:00:00 2001 From: Tanner Stirrat Date: Thu, 3 Oct 2024 12:30:30 -0600 Subject: [PATCH 2/2] Revert changes to branch protections --- .github/workflows/publish.yaml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 1486574..d6c301f 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -2,13 +2,9 @@ # yamllint disable rule:line-length name: "Publish to NPM" on: # yamllint disable-line rule:truthy - #release: - #types: - #- "published" - # NOTE: this is temporary until I get the release process ironed out. - pull_request: - branches: - - "*" + release: + types: + - "published" jobs: publish: @@ -20,7 +16,6 @@ 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: | @@ -29,7 +24,7 @@ jobs: echo "VERSION=$VERSION" >> $GITHUB_ENV # NOTE: the flag is necessary because otherwise `npm version ` attempts to # cut a git tag with that version, which fails because the git user isn't configured. - - run: "npm version 1.0.2 --no-git-tag-version" + - run: "npm version ${VERSION} --no-git-tag-version" - uses: JS-DevTools/npm-publish@v3 with: token: ${{ secrets.NPM_TOKEN }} @@ -60,7 +55,7 @@ jobs: echo "VERSION=$VERSION" >> $GITHUB_ENV # NOTE: the flag is necessary because otherwise `npm version ` attempts to # cut a git tag with that version, which fails because the git user isn't configured. - - run: "npm version 1.0.2 --no-git-tag-version" + - run: "npm version ${VERSION} --no-git-tag-version" working-directory: ./js-dist - uses: JS-DevTools/npm-publish@v3 with: