From fce135e4b5b27dc89f1a2e1f138fa78078bfeba3 Mon Sep 17 00:00:00 2001 From: Coby Date: Wed, 27 Nov 2024 12:42:18 -0500 Subject: [PATCH 1/5] automatically tag version number after release --- .github/workflows/build-action.yml | 14 ++++++++++++++ .github/workflows/release.yml | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/.github/workflows/build-action.yml b/.github/workflows/build-action.yml index 402107ea05..732cd6d108 100644 --- a/.github/workflows/build-action.yml +++ b/.github/workflows/build-action.yml @@ -301,6 +301,8 @@ jobs: run: | npm ci npm run prepublishOnly + + - name: Publish to NPM if version has changed uses: JS-DevTools/npm-publish@v3 with: @@ -308,6 +310,18 @@ jobs: strategy: upgrade env: INPUT_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Determine released version + id: version + run: echo "::set-output name=version::$(node -p "require('./package.json').version")" + + - name: Tag new version + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN}} + RELEASED_VERSION: ${{ steps.version.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 67e89f95bb..a2bdeb66d8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,3 +80,16 @@ jobs: gh pr create --base main --head $NEW_BRANCH --title "Release $NEW_VERSION [CHECK SEMVER BEFORE MERGE]" --body "This is an automated PR to update to version $NEW_VERSION. Please check [SemVer](https://semver.org/) for correct versioning before merging this PR." env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN}} + + - name: Determine released version + id: version + run: echo "::set-output name=version::$(node -p "require('./package.json').version")" + + - name: Tag new version + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN}} + RELEASED_VERSION: ${{ steps.version.outputs.version }} + run: | + git tag $RELEASED_VERSION + git push origin $RELEASED_VERSION + From a736d3ebcff4616e00ac59e45ee7e186d37689d8 Mon Sep 17 00:00:00 2001 From: Coby Date: Wed, 27 Nov 2024 12:48:59 -0500 Subject: [PATCH 2/5] use release step output instead --- .github/workflows/build-action.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-action.yml b/.github/workflows/build-action.yml index 732cd6d108..3c43c04f95 100644 --- a/.github/workflows/build-action.yml +++ b/.github/workflows/build-action.yml @@ -304,6 +304,7 @@ jobs: - name: Publish to NPM if version has changed + id: publish uses: JS-DevTools/npm-publish@v3 with: token: ${{ secrets.NPM_TOKEN }} @@ -311,18 +312,16 @@ jobs: env: INPUT_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Determine released version - id: version - run: echo "::set-output name=version::$(node -p "require('./package.json').version")" - - 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.version.outputs.version }} + 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' timeout-minutes: 180 From c785a526c3d86880837dfe8972c00473b31e1d76 Mon Sep 17 00:00:00 2001 From: Coby Date: Wed, 27 Nov 2024 12:49:52 -0500 Subject: [PATCH 3/5] nit --- .github/workflows/build-action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-action.yml b/.github/workflows/build-action.yml index 3c43c04f95..8d7844e142 100644 --- a/.github/workflows/build-action.yml +++ b/.github/workflows/build-action.yml @@ -302,7 +302,6 @@ jobs: npm ci npm run prepublishOnly - - name: Publish to NPM if version has changed id: publish uses: JS-DevTools/npm-publish@v3 @@ -315,7 +314,7 @@ jobs: - 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}} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} RELEASED_VERSION: ${{ steps.publish.outputs.version }} run: | git tag $RELEASED_VERSION From 7dc66b540a2ae7b841f065b06983498f63fbb4ef Mon Sep 17 00:00:00 2001 From: Coby Date: Wed, 27 Nov 2024 12:50:38 -0500 Subject: [PATCH 4/5] rm release yml changes --- .github/workflows/release.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a2bdeb66d8..67e89f95bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,16 +80,3 @@ jobs: gh pr create --base main --head $NEW_BRANCH --title "Release $NEW_VERSION [CHECK SEMVER BEFORE MERGE]" --body "This is an automated PR to update to version $NEW_VERSION. Please check [SemVer](https://semver.org/) for correct versioning before merging this PR." env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN}} - - - name: Determine released version - id: version - run: echo "::set-output name=version::$(node -p "require('./package.json').version")" - - - name: Tag new version - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN}} - RELEASED_VERSION: ${{ steps.version.outputs.version }} - run: | - git tag $RELEASED_VERSION - git push origin $RELEASED_VERSION - From 99549d466cce02056e5b13f576adfd849d376430 Mon Sep 17 00:00:00 2001 From: Coby Date: Mon, 2 Dec 2024 10:43:22 -0500 Subject: [PATCH 5/5] rm tag deletion step --- .github/workflows/release.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 67e89f95bb..707b5245a5 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