-
Notifications
You must be signed in to change notification settings - Fork 158
ci: create a separate release workflow for zetaclient and zetacore #4329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
44f753d
publish release actions
lumtis eebdcea
gorelease new files
lumtis 901e14e
fix security warning
lumtis 0d85c75
fix coderabbit comments
lumtis b1cc765
Merge branch 'develop' into ci/zetaclient-release
lumtis 7e45d89
reorganize workflow
lumtis 7d7b19c
Update .github/workflows/release-template.yml
lumtis ca07558
Update .github/workflows/release-template.yml
lumtis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| 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: | ||
| 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, 'refs/heads/release/zetaclient/') | ||
| 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 | ||
| run: | | ||
| make release-snapshot-zetaclient | ||
|
|
||
| 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 | ||
| shell: bash | ||
| run: | | ||
| git tag ${GITHUB_TAG_VERSION} | ||
| create_tag=$(git push --tags || echo "tag exists") | ||
| if [[ $create_tag == "tag exists" ]]; then | ||
| echo "Delete existing tag to re-create" | ||
| git tag -d ${GITHUB_TAG_VERSION} | ||
| git push --delete origin ${GITHUB_TAG_VERSION} | ||
| echo "sleep for 5 seconds to let github catch up." | ||
| sleep 5 | ||
| echo "Re-Create Tag." | ||
| git tag ${GITHUB_TAG_VERSION} | ||
| git push --tags | ||
| fi | ||
|
|
||
| - 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 ZetaClient Release Files | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GORELEASER_CURRENT_TAG: ${{ env.GITHUB_TAG_VERSION }} | ||
| run: | | ||
| touch .release-env | ||
| make release-zetaclient | ||
|
|
||
| - name: Artifact Attestations | ||
| id: attestation | ||
| uses: actions/attest-build-provenance@v2 | ||
| with: | ||
| subject-path: | | ||
| dist/zetaclientd_**/* | ||
| dist/zetae2e_**/* | ||
| dist/checksums.txt | ||
|
|
||
| - name: Upload Attestation Bundle | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| shell: bash | ||
| run: | | ||
| gh release upload ${{ env.GITHUB_TAG_VERSION }} ${{ steps.attestation.outputs.bundle-path }} | ||
lumtis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Clean Up Workspace | ||
| if: always() | ||
| shell: bash | ||
| run: sudo rm -rf * || echo "failed to cleanup workspace please investigate" | ||
|
|
||
| publish-typescript: | ||
| needs: publish-release | ||
lumtis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| uses: ./.github/workflows/publish-typescript.yml | ||
| secrets: inherit | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| name: Publish ZetaCore Release | ||
lumtis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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: | ||
| 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, 'refs/heads/release/zetacore/') | ||
| 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 | ||
| run: | | ||
| make release-snapshot-zetacore | ||
|
|
||
| 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 | ||
| shell: bash | ||
| run: | | ||
| git tag ${GITHUB_TAG_VERSION} | ||
| create_tag=$(git push --tags || echo "tag exists") | ||
| if [[ $create_tag == "tag exists" ]]; then | ||
| echo "Delete existing tag to re-create" | ||
| git tag -d ${GITHUB_TAG_VERSION} | ||
| git push --delete origin ${GITHUB_TAG_VERSION} | ||
| echo "sleep for 5 seconds to let github catch up." | ||
| sleep 5 | ||
| echo "Re-Create Tag." | ||
| git tag ${GITHUB_TAG_VERSION} | ||
| git push --tags | ||
| fi | ||
|
|
||
| - 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 ZetaCore Release Files | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GORELEASER_CURRENT_TAG: ${{ env.GITHUB_TAG_VERSION }} | ||
| run: | | ||
| touch .release-env | ||
| make release-zetacore | ||
|
|
||
| - name: Artifact Attestations | ||
| id: attestation | ||
| uses: actions/attest-build-provenance@v2 | ||
| with: | ||
| subject-path: | | ||
| dist/zetacored_**/* | ||
| dist/checksums.txt | ||
|
|
||
| - name: Upload Attestation Bundle | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| shell: bash | ||
| run: | | ||
| gh release upload ${{ env.GITHUB_TAG_VERSION }} ${{ steps.attestation.outputs.bundle-path }} | ||
|
|
||
lumtis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - name: Clean Up Workspace | ||
| if: always() | ||
| shell: bash | ||
| run: sudo rm -rf * || echo "failed to cleanup workspace please investigate" | ||
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| env: | ||
lumtis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - 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 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.