diff --git a/.github/workflows/build-action.yml b/.github/workflows/build-action.yml index 1e3e7a389..1a540c97b 100644 --- a/.github/workflows/build-action.yml +++ b/.github/workflows/build-action.yml @@ -301,13 +301,25 @@ jobs: run: | npm ci npm run prepublishOnly + - name: Publish to NPM if version has changed + id: publish uses: JS-DevTools/npm-publish@v3 with: token: ${{ secrets.NPM_TOKEN }} strategy: upgrade env: INPUT_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Tag new version + if: ${{ steps.publish.outputs.type }} # https://github.com/JS-DevTools/npm-publish?tab=readme-ov-file#action-output + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASED_VERSION: ${{ steps.publish.outputs.version }} + run: | + git tag $RELEASED_VERSION + git push origin $RELEASED_VERSION + Release-mina-signer-on-NPM: if: github.ref == 'refs/heads/main' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 67e89f95b..707b5245a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,13 +58,6 @@ jobs: git add CHANGELOG.md git commit -m "Update CHANGELOG for new version $NEW_VERSION" - - name: Delete existing release tag - run: | - if git rev-parse $NEW_VERSION >/dev/null 2>&1; then - git tag -d $NEW_VERSION - git push origin :refs/tags/$NEW_VERSION - fi - - name: Delete existing release branch run: | if git ls-remote --heads origin release/${NEW_VERSION} | grep release/${NEW_VERSION}; then