From 88eb5f9613a772f33573bdf19df9abeb8ed75c71 Mon Sep 17 00:00:00 2001 From: Tyler <48813565+technicallyty@users.noreply.github.com> Date: Fri, 7 Mar 2025 12:14:16 -0800 Subject: [PATCH] ci: add releaser for simapp (#23922) Co-authored-by: Alex | Interchain Labs --- .github/workflows/release-simd.yml | 40 ++++++++++++++++++++++++++ simapp/.goreleaser.yml | 46 ++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 .github/workflows/release-simd.yml create mode 100644 simapp/.goreleaser.yml diff --git a/.github/workflows/release-simd.yml b/.github/workflows/release-simd.yml new file mode 100644 index 0000000000..24c8c4e419 --- /dev/null +++ b/.github/workflows/release-simd.yml @@ -0,0 +1,40 @@ +name: Release Simd + +on: + push: + tags: + - "simd/v*.*.*" +permissions: + contents: read + +jobs: + goreleaser: + permissions: + contents: write # for goreleaser/goreleaser-action to create a GitHub release + runs-on: depot-ubuntu-22.04-4 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: + go-version: "1.23" + check-latest: true + - name: Set env + run: | + echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/simd/}" >> $GITHUB_ENV + echo "FULL_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + - name: Tag without prefix locally to avoid error in goreleaser + run: |- + git tag -d ${{ env.RELEASE_VERSION }} || echo "No such a tag exists before" + git tag ${{ env.RELEASE_VERSION }} HEAD + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v3 + with: + version: v2.19.0 + args: release --clean + workdir: . + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GORELEASER_CURRENT_TAG: ${{ env.RELEASE_VERSION }} + SIMD_FULL_TAG: ${{ env.FULL_TAG }} \ No newline at end of file diff --git a/simapp/.goreleaser.yml b/simapp/.goreleaser.yml new file mode 100644 index 0000000000..0fd9aebab9 --- /dev/null +++ b/simapp/.goreleaser.yml @@ -0,0 +1,46 @@ +project_name: simd + +version: 2 + +release: + disable: false + name_template: "{{.Env.SIMD_FULL_TAG}}" + +before: + hooks: + - go mod tidy + +builds: + - main: ./simd + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + env: + - LEDGER_ENABLED=true + flags: + - -trimpath + - -mod=readonly + tags: + - netgo + - ledger + ldflags: + - '-X github.com/cosmos/cosmos-sdk/version.Name=sim' + - '-X github.com/cosmos/cosmos-sdk/version.AppName=simd' + - '-X github.com/cosmos/cosmos-sdk/version.Version={{.Version}}' + - '-X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}}' + - '-X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger"' + - '-w' + - '-s' + +archives: + - name_template: '{{ replace .Version "simd/" "simd-" }}-{{ .Os }}-{{ .Arch }}' + +checksum: + name_template: 'SHA256SUMS-{{ replace .Version "simd/" "simd-" }}.txt' + algorithm: sha256 + +changelog: + disable: true \ No newline at end of file