ci: add releaser for simapp (#23922)

Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io>
This commit is contained in:
Tyler 2025-03-07 12:14:16 -08:00 committed by GitHub
parent f38f05040c
commit 88eb5f9613
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 86 additions and 0 deletions

40
.github/workflows/release-simd.yml vendored Normal file
View File

@ -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 }}

46
simapp/.goreleaser.yml Normal file
View File

@ -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