Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Release
name: Publish Release Legacy

on:
workflow_dispatch:
Expand All @@ -19,7 +19,7 @@ on:
description: 'Only run pre-release checks'

concurrency:
group: publish-release
group: publish-release-legacy
cancel-in-progress: false

jobs:
Expand Down Expand Up @@ -74,8 +74,10 @@ jobs:
cat changelog-current.md

- name: Set Version
env:
VERSION_INPUT: ${{ inputs.version }}
run: |
echo "GITHUB_TAG_VERSION=${{ inputs.version }}" >> ${GITHUB_ENV}
echo "GITHUB_TAG_VERSION=${VERSION_INPUT}" >> ${GITHUB_ENV}

- name: Create Release Tag
shell: bash
Expand Down Expand Up @@ -133,6 +135,6 @@ jobs:
run: sudo rm -rf * || echo "failed to cleanup workspace please investigate"

publish-typescript:
needs: publish-release
needs: publish-release-legacy
uses: ./.github/workflows/publish-typescript.yml
secrets: inherit
40 changes: 40 additions & 0 deletions .github/workflows/publish-release-zetaclient.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish ZetaClient Release

on:
workflow_dispatch:
inputs:
version:
description: 'Version for ZetaClient Release (e.g., v2.5.0)'
required: true
skip_checks:
type: boolean
required: false
default: false
description: 'Skip pre-release checks'
skip_release:
type: boolean
required: false
default: false
description: 'Only run pre-release checks'

concurrency:
group: publish-release-zetaclient
cancel-in-progress: false

jobs:
release:
uses: ./.github/workflows/release-template.yml
with:
version: ${{ inputs.version }}
skip_checks: ${{ inputs.skip_checks }}
skip_release: ${{ inputs.skip_release }}
component: 'zetaclient'
branch_prefix: 'release/zetaclient/'
make_snapshot_target: 'release-snapshot-zetaclient'
make_release_target: 'release-zetaclient'
attestation_paths: |
dist/zetaclientd_**/*
dist/zetae2e_**/*
dist/checksums.txt
include_typescript: false
secrets: inherit
39 changes: 39 additions & 0 deletions .github/workflows/publish-release-zetacore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish ZetaCore Release

on:
workflow_dispatch:
inputs:
version:
description: 'Version for ZetaCore Release (e.g., v36.0.0)'
required: true
skip_checks:
type: boolean
required: false
default: false
description: 'Skip pre-release checks'
skip_release:
type: boolean
required: false
default: false
description: 'Only run pre-release checks'

concurrency:
group: publish-release-zetacore
cancel-in-progress: false

jobs:
release:
uses: ./.github/workflows/release-template.yml
with:
version: ${{ inputs.version }}
skip_checks: ${{ inputs.skip_checks }}
skip_release: ${{ inputs.skip_release }}
component: 'zetacore'
branch_prefix: 'release/zetacore/'
make_snapshot_target: 'release-snapshot-zetacore'
make_release_target: 'release-zetacore'
attestation_paths: |
dist/zetacored_**/*
dist/checksums.txt
include_typescript: true
secrets: inherit
150 changes: 150 additions & 0 deletions .github/workflows/release-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: Release Template (Reusable)

on:
workflow_call:
inputs:
version:
description: 'Version for Release'
required: true
type: string
skip_checks:
type: boolean
required: false
default: false
skip_release:
type: boolean
required: false
default: false
component:
description: 'Component to release (zetacore or zetaclient)'
required: true
type: string
branch_prefix:
description: 'Expected branch prefix (e.g., release/zetacore/)'
required: true
type: string
make_snapshot_target:
description: 'Make target for snapshot (e.g., release-snapshot-zetacore)'
required: true
type: string
make_release_target:
description: 'Make target for release (e.g., release-zetacore)'
required: true
type: string
attestation_paths:
description: 'Paths for attestation (multiline string)'
required: true
type: string
include_typescript:
description: 'Whether to publish TypeScript after release'
type: boolean
default: false

jobs:
log:
runs-on: ubuntu-22.04
steps:
- name: "Log inputs"
env:
INPUTS: ${{ toJson(inputs) }}
run: echo "${INPUTS}" | jq -r

check-branch:
if: startsWith(github.ref, format('refs/heads/{0}', inputs.branch_prefix))
runs-on: ubuntu-22.04
steps:
- name: Branch
run: echo "${{ github.ref }}"

check-goreleaser:
runs-on: ${{ vars.RELEASE_RUNNER }}
steps:
- uses: actions/checkout@v4
- name: Build release snapshot
if: inputs.skip_checks != true
env:
MAKE_SNAPSHOT_TARGET: ${{ inputs.make_snapshot_target }}
run: make "$MAKE_SNAPSHOT_TARGET"

publish-release:
permissions:
id-token: write
contents: write
attestations: write
if: inputs.skip_release != true
needs:
- check-branch
- check-goreleaser
runs-on: ${{ vars.RELEASE_RUNNER }}
timeout-minutes: 60
environment: release
steps:
- uses: actions/checkout@v4

- name: Change Log Release Notes
id: release_notes
run: |
awk '/^## /{flag++} flag==1{print}' changelog.md > changelog-current.md
cat changelog-current.md

- name: Set Version
env:
VERSION_INPUT: ${{ inputs.version }}
run: echo "GITHUB_TAG_VERSION=${VERSION_INPUT}" >> ${GITHUB_ENV}

- name: Create Release Tag
env:
TAG_VERSION: ${{ inputs.version }}
shell: bash
run: |
if git rev-parse "${TAG_VERSION}" >/dev/null 2>&1; then
echo "Error: Tag ${TAG_VERSION} already exists!"
echo "If you need to re-release, either:"
echo " 1. Use a new version number (recommended)"
echo " 2. Manually delete the tag first with: git push --delete origin ${TAG_VERSION}"
exit 1
fi
git tag "${TAG_VERSION}"
git push --tags

- name: Create GitHub Release
uses: softprops/action-gh-release@v2.2.0
with:
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}
body_path: changelog-current.md
tag_name: ${{ env.GITHUB_TAG_VERSION }}
generate_release_notes: false

- name: Publish Release Files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_CURRENT_TAG: ${{ env.GITHUB_TAG_VERSION }}
env:
MAKE_RELEASE_TARGET: ${{ inputs.make_release_target }}
run: |
touch .release-env
make "$MAKE_RELEASE_TARGET"
- name: Artifact Attestations
id: attestation
uses: actions/attest-build-provenance@v2
with:
subject-path: ${{ inputs.attestation_paths }}

- name: Upload Attestation Bundle
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_VERSION: ${{ env.GITHUB_TAG_VERSION }}
shell: bash
run: gh release upload "${TAG_VERSION}" "${{ steps.attestation.outputs.bundle-path }}"

- name: Clean Up Workspace
if: always()
shell: bash
run: sudo rm -rf * || echo "failed to cleanup workspace please investigate"

publish-typescript:
if: inputs.include_typescript
needs: publish-release
uses: ./.github/workflows/publish-typescript.yml
secrets: inherit
81 changes: 81 additions & 0 deletions .goreleaser-zetaclient.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
env:
- CGO_ENABLED=1
- CC_linux_arm64=aarch64-linux-gnu-gcc
- CXX_linux_arm64=aarch64-linux-gnu-g++
- CC_linux_amd64=x86_64-linux-gnu-gcc
- CXX_linux_amd64=x86_64-linux-gnu-g++
- VERSION={{ .Version }}
- BUILDTIME={{ .Date }}

before:
hooks:
- go mod download
- go mod tidy

builds:
- id: "zetaclientd"
main: ./cmd/zetaclientd
binary: "zetaclientd-{{ .Os }}-{{ .Arch }}"
env:
- 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}'
- 'CXX={{ index .Env (print "CXX_" .Os "_" .Arch) }}'
goos:
- linux
goarch:
- arm64
- amd64
flags: &default_flags
- -tags=pebbledb,ledger
ldflags: &default_ldflags
- -X github.com/cosmos/cosmos-sdk/version.Name=zetacore
- -X github.com/cosmos/cosmos-sdk/version.ServerName=zetacored
- -X github.com/cosmos/cosmos-sdk/version.ClientName=zetaclientd
- -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .FullCommit }}
- -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb
- -X github.com/zeta-chain/node/pkg/constant.Name=zetacored
- -X github.com/zeta-chain/node/pkg/constant.Version={{ .Version }}
- -X github.com/zeta-chain/node/pkg/constant.CommitHash={{ .FullCommit }}
- -X github.com/zeta-chain/node/pkg/constant.BuildTime={{ .CommitDate }}
- -X main.version={{ .Version }}
- -X main.commit={{ .Commit }}
- -X main.date={{ .CommitDate }}
- -buildid=
- -s -w

- id: "zetae2e"
main: ./cmd/zetae2e
binary: "zetae2e-{{ .Os }}-{{ .Arch }}"
env:
- 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}'
- 'CXX={{ index .Env (print "CXX_" .Os "_" .Arch) }}'
goos:
- linux
goarch:
- arm64
- amd64
flags: *default_flags
ldflags: *default_ldflags

archives:
- format: binary
name_template: "{{ .Binary }}"

checksum:
name_template: "checksums.txt"

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

snapshot:
name_template: "{{ .Tag }}-next"

release:
draft: false
target_commitish: "{{ .FullCommit }}"
prerelease: auto
mode: append
Loading