From 0cffdb2d26441712d72d3cd021f509c5cfe7220d Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Thu, 2 Nov 2023 11:56:50 -0600 Subject: [PATCH 1/4] updated --- .github/workflows/publish-release.yml | 89 +++++++++++++++++---------- .github/workflows/rc-release.yml | 35 +++-------- 2 files changed, 68 insertions(+), 56 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 773ff28c4d..a8338b7335 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -1,19 +1,25 @@ name: Publish Release on: - push: - tags: - - "v*.*.*" - + pull_request: + types: + - closed + branches: + - 'main' + workflow_dispatch: + inputs: + version: + description: 'Version for manual hotfix release.' + required: false + default: '' + concurrency: group: publish-release cancel-in-progress: false -env: - GITHUB_REF_NAME: "$(echo ${{ github.ref_name }} | tr '//' '-')" - jobs: pre-release-checks: + if: github.event.pull_request.merged == true runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -21,6 +27,16 @@ jobs: with: fetch-depth: 0 + - name: Set Version from the PR title. + if: github.event_name == 'pull_request' + run: | + echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.pull_request.title }}" >> ${GITHUB_ENV} + + - name: Set Version for Hotfix Release from Input. + if: github.event_name != 'pull_request' + run: | + echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.inputs.version }}" >> ${GITHUB_ENV} + - name: Major Version in Upgrade Handler Must Match Tag run: | UPGRADE_HANDLER_MAJOR_VERSION=$(cat app/setup_handlers.go | grep "const releaseVersion" | cut -d ' ' -f4 | tr -d '"' | cut -d '.' -f1) @@ -34,6 +50,7 @@ jobs: echo "The major version found in 'releaseVersion' in app/setup_handlers.go matches this tagged release - Moving Forward!" publish-release: + if: github.event.pull_request.merged == true runs-on: buildjet-4vcpu-ubuntu-2004 timeout-minutes: 60 needs: @@ -41,6 +58,21 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Echo Release Notes from PR Message. + if: github.event_name == 'pull_request' + run: | + echo -e "${{ github.event.head_commit.message }}" > Release.txt + + - name: Set Version from the PR title. + if: github.event_name == 'pull_request' + run: | + echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.pull_request.title }}" >> ${GITHUB_ENV} + + - name: Set Version for Hotfix Release from Input. + if: github.event_name != 'pull_request' + run: | + echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.inputs.version }}" >> ${GITHUB_ENV} + - name: Set CPU Architecture shell: bash run: | @@ -62,7 +94,15 @@ jobs: skip_aws_cli: "true" skip_docker_compose: "true" - - name: Create GitHub Release + - name: Create GitHub Release on Pull Request + if: github.event_name == 'pull_request' + uses: softprops/action-gh-release@v1 + with: + token: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} + files: Release.txt + + - name: Create GitHub Release Hot Fix + if: github.event_name != 'pull_request' uses: softprops/action-gh-release@v1 with: token: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} @@ -75,17 +115,17 @@ jobs: touch .release-env make release - ## TODO - Will add in later after optimizing docker images - # - name: Build, tag, and push docker images - # uses: ./.github/actions/build-docker-images - # with: - # DOCKER_FILENAME: Dockerfile - # REPOSITORY_NAME: zeta-node - # IMAGE_TAG: ${{ env.TAG_NAME }} - # GHCR_USERNAME: ${{ secrets.PAT_GITHUB_SERVICE_ACCT_USERNAME }} - # GHCR_TOKEN: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} + - name: Build, tag, and push docker images + uses: ./.github/actions/build-docker-images + with: + DOCKER_FILENAME: Dockerfile-relese + REPOSITORY_NAME: zeta-node + IMAGE_TAG: ${{ env.GITHUB_TAG_MAJOR_VERSION }} + GHCR_USERNAME: ${{ secrets.PAT_GITHUB_SERVICE_ACCT_USERNAME }} + GHCR_TOKEN: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} build-alpine: + if: github.event.pull_request.merged == true runs-on: ["ubuntu-latest"] timeout-minutes: 30 concurrency: @@ -175,6 +215,7 @@ jobs: run: rm -rf * announce-release: + if: github.event.pull_request.merged == true runs-on: ubuntu-latest timeout-minutes: 10 needs: @@ -213,20 +254,6 @@ jobs: See the release notes for more details. https://github.com/zeta-chain/node/releases/tag/${{ env.BINARY_VERSION }} - # - name: "SEND:DISCORD:MESSAGE" - # if: steps.determine_release_type.outputs.RELEASE_TYPE == 'minor' - # uses: gzukel/CosmosComposites/send_discord_message@main - # with: - # discord_token: "${{ secrets.DISCORD_TOKEN }}" - # discord_channel_id: "${{ secrets.DISCORD_CHANNEL_ID }}" - # discord_message: | - # Hey <@&1122981184255840306>! A new version of the zetachain node has been released. - - # Minor Version Upgrade (e.g. v5.0.x to v5.1.x) can be applied without a governance proposal. - # Please review the release notes for any specific upgrade instructions or considerations. - - # See the release notes for more details. https://github.com/zeta-chain/node/releases/tag/${{ env.BINARY_VERSION }} - - name: Clean Up Workspace if: always() shell: bash diff --git a/.github/workflows/rc-release.yml b/.github/workflows/rc-release.yml index f18a7d58f5..e31e9bb3af 100644 --- a/.github/workflows/rc-release.yml +++ b/.github/workflows/rc-release.yml @@ -1,4 +1,4 @@ -name: Publish Release +name: Publish Release Candidate Release on: push: @@ -6,7 +6,7 @@ on: - "v*.*.*-rc" concurrency: - group: publish-release + group: publish-rc-release cancel-in-progress: false env: @@ -75,15 +75,14 @@ jobs: touch .release-env make release - ## TODO - Will add in later after optimizing docker images - # - name: Build, tag, and push docker images - # uses: ./.github/actions/build-docker-images - # with: - # DOCKER_FILENAME: Dockerfile - # REPOSITORY_NAME: zeta-node - # IMAGE_TAG: ${{ env.TAG_NAME }} - # GHCR_USERNAME: ${{ secrets.PAT_GITHUB_SERVICE_ACCT_USERNAME }} - # GHCR_TOKEN: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} + - name: Build, tag, and push docker images + uses: ./.github/actions/build-docker-images + with: + DOCKER_FILENAME: Dockerfile-relese + REPOSITORY_NAME: zeta-node + IMAGE_TAG: ${{ env.GITHUB_TAG_MAJOR_VERSION }} + GHCR_USERNAME: ${{ secrets.PAT_GITHUB_SERVICE_ACCT_USERNAME }} + GHCR_TOKEN: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} build-alpine: runs-on: ["ubuntu-latest"] @@ -213,20 +212,6 @@ jobs: See the release notes for more details. https://github.com/zeta-chain/node/releases/tag/${{ env.BINARY_VERSION }} - # - name: "SEND:DISCORD:MESSAGE" - # if: steps.determine_release_type.outputs.RELEASE_TYPE == 'minor' - # uses: gzukel/CosmosComposites/send_discord_message@main - # with: - # discord_token: "${{ secrets.DISCORD_TOKEN }}" - # discord_channel_id: "${{ secrets.DISCORD_CHANNEL_ID }}" - # discord_message: | - # Hey <@&1122981184255840306>! A new version of the zetachain node has been released. - - # Minor Version Upgrade (e.g. v5.0.x to v5.1.x) can be applied without a governance proposal. - # Please review the release notes for any specific upgrade instructions or considerations. - - # See the release notes for more details. https://github.com/zeta-chain/node/releases/tag/${{ env.BINARY_VERSION }} - - name: Clean Up Workspace if: always() shell: bash From a6f65f2e5f97806613654ce9d63586ee23dfcf84 Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Thu, 2 Nov 2023 11:57:29 -0600 Subject: [PATCH 2/4] updated --- app/setup_handlers.go | 2 +- version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/setup_handlers.go b/app/setup_handlers.go index 18a8ae1f62..0482a092ea 100644 --- a/app/setup_handlers.go +++ b/app/setup_handlers.go @@ -8,7 +8,7 @@ import ( observertypes "github.com/zeta-chain/zetacore/x/observer/types" ) -const releaseVersion = "v10.1.0" +const releaseVersion = "v11.1.0" func SetupHandlers(app *App) { app.UpgradeKeeper.SetUpgradeHandler(releaseVersion, func(ctx sdk.Context, plan types.Plan, vm module.VersionMap) (module.VersionMap, error) { diff --git a/version b/version index 6eaf894335..1ead6ba253 100644 --- a/version +++ b/version @@ -1 +1 @@ -v2.0.0 \ No newline at end of file +v11.1.0 \ No newline at end of file From 33ac331ede9b6ea2645e446ec7784fb4c9495a87 Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Thu, 2 Nov 2023 12:00:05 -0600 Subject: [PATCH 3/4] updated version --- app/setup_handlers.go | 2 +- version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/setup_handlers.go b/app/setup_handlers.go index 0482a092ea..51d0377c02 100644 --- a/app/setup_handlers.go +++ b/app/setup_handlers.go @@ -8,7 +8,7 @@ import ( observertypes "github.com/zeta-chain/zetacore/x/observer/types" ) -const releaseVersion = "v11.1.0" +const releaseVersion = "v12.1.0" func SetupHandlers(app *App) { app.UpgradeKeeper.SetUpgradeHandler(releaseVersion, func(ctx sdk.Context, plan types.Plan, vm module.VersionMap) (module.VersionMap, error) { diff --git a/version b/version index 1ead6ba253..f08fdfcf7a 100644 --- a/version +++ b/version @@ -1 +1 @@ -v11.1.0 \ No newline at end of file +v12.1.0 \ No newline at end of file From 273e7f823874e2632d1577e719c3d8766d8bedf3 Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Thu, 2 Nov 2023 12:11:00 -0600 Subject: [PATCH 4/4] updated --- .github/workflows/publish-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index a8338b7335..ef95e18145 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -39,7 +39,7 @@ jobs: - name: Major Version in Upgrade Handler Must Match Tag run: | - UPGRADE_HANDLER_MAJOR_VERSION=$(cat app/setup_handlers.go | grep "const releaseVersion" | cut -d ' ' -f4 | tr -d '"' | cut -d '.' -f1) + UPGRADE_HANDLER_MAJOR_VERSION=$(cat app/setup_handlers.go | grep "const releaseVersion" | cut -d ' ' -f4 | tr -d '"') echo $UPGRADE_HANDLER_MAJOR_VERSION GITHUB_TAG_MAJOR_VERSION=$(echo ${{ github.ref_name }} | cut -d '.' -f1) if [ $GITHUB_TAG_MAJOR_VERSION != $UPGRADE_HANDLER_MAJOR_VERSION ]; then