Publish Release Candidate Release #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Release Candidate Release | |
on: | |
push: | |
tags: | |
- "v*.*.*-rc" | |
concurrency: | |
group: publish-rc-release | |
cancel-in-progress: false | |
env: | |
GITHUB_REF_NAME: "$(echo ${{ github.ref_name }} | tr '//' '-')" | |
jobs: | |
pre-release-checks: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- 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) | |
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 | |
echo "ERROR: The major version of this release (${{ github.ref_name }}) does not match the major version in the releaseVersion constant ($UPGRADE_HANDLER_MAJOR_VERSION) found in app/setup_handlers.go" | |
echo "Did you forget to update the 'releaseVersion' in app/setup_handlers.go?" | |
exit 1 | |
fi | |
echo "The major version found in 'releaseVersion' in app/setup_handlers.go matches this tagged release - Moving Forward!" | |
publish-release: | |
runs-on: buildjet-4vcpu-ubuntu-2004 | |
timeout-minutes: 60 | |
needs: | |
- pre-release-checks | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set CPU Architecture | |
shell: bash | |
run: | | |
if [ "$(uname -m)" == "aarch64" ]; then | |
echo "CPU_ARCH=arm64" >> $GITHUB_ENV | |
elif [ "$(uname -m)" == "x86_64" ]; then | |
echo "CPU_ARCH=amd64" >> $GITHUB_ENV | |
else | |
echo "Unsupported architecture" >&2 | |
exit 1 | |
fi | |
- name: Echo Release Notes from PR Message. | |
id: release_notes | |
run: | | |
cat changelog.md > ${{ github.workspace }}-CHANGELOG.txt | |
cat ${{ github.workspace }}-CHANGELOG.txt | |
- name: Install Pipeline Dependencies | |
uses: ./.github/actions/install-dependencies | |
timeout-minutes: 8 | |
with: | |
cpu_architecture: ${{ env.CPU_ARCH }} | |
skip_python: "true" | |
skip_aws_cli: "true" | |
skip_docker_compose: "true" | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} | |
body_path: ${{ github.workspace }}-CHANGELOG.txt | |
generate_release_notes: true | |
- name: Publish Release Files | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} | |
run: | | |
touch .release-env | |
make release | |
announce-release: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: | |
- publish-release | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get Version | |
run: | | |
VERSION=$(cat app/setup_handlers.go | grep "const releaseVersion" | cut -d ' ' -f4 | tr -d '"') | |
echo "BINARY_VERSION=${VERSION}" >> ${GITHUB_ENV} | |
- name: Determine Release Type | |
id: determine_release_type | |
run: | | |
if [[ "${{ env.BINARY_VERSION }}" =~ ^v[0-9]+\.0\.0+$ ]]; then | |
echo "RELEASE_TYPE=major" >> ${GITHUB_ENV} | |
elif [[ "${{ env.BINARY_VERSION }}" =~ ^v[0-9]+\.[0-9]+\.[1-9]+$ ]]; then | |
echo "RELEASE_TYPE=minor" >> ${GITHUB_ENV} | |
else | |
echo "RELEASE_TYPE=unknown" >> ${GITHUB_ENV} | |
fi | |
- name: "SEND:DISCORD:MESSAGE" | |
if: steps.determine_release_type.outputs.RELEASE_TYPE == 'major' | |
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 software has been released. | |
Major Version Upgrade (e.g. v5.x.x to V6.x.x) must be completed through a governance proposal. | |
We will submit a governance proposal in the next few days. | |
More specific information including block height will be shared as part of the governance proposal. | |
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 | |
run: rm -rf * |