Skip to content

Commit

Permalink
add goreleaser github action to attach simd binary to releases and pr…
Browse files Browse the repository at this point in the history
…e-releases (#738)

Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>
(cherry picked from commit 87b058d)
  • Loading branch information
crodriguezvega authored and mergify-bot committed Jan 19, 2022
1 parent 12f43fb commit cfb2edd
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-?[a-z0-9]*' # Push events to matching v*, i.e. v1.0.0, v20.15.10, v3.0.0-alpha1

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
with:
fetch-depth: 0

- uses: actions/setup-go@v2
with:
go-version: '1.17'

- name: Release
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 changes: 35 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
before:
hooks:
- go mod tidy

builds:
- main: ./testing/simapp/simd/main.go
binary: simd
flags:
- -tags=netgo ledger
- -mod=readonly
ldflags:
- -s -w -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.BuildTags=netgo,ledger"
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
# for goarch use defaults: 386, amd64 and arm64.

checksum:
name_template: SHA256SUMS-{{.Version}}.txt
algorithm: sha256

release:
mode: keep-existing

archives:
- name_template: "{{ .ProjectName }}_simd_v{{ .Version }}_{{ .Os }}_{{ .Arch }}"
files:
- LICENSE
- README.md
- RELEASES.md
- SECURITY.md
- CHANGELOG.md

0 comments on commit cfb2edd

Please sign in to comment.