-
Notifications
You must be signed in to change notification settings - Fork 690
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: release workflow setup (#1409)
* updates * updates * updates
- Loading branch information
1 parent
ee5bf99
commit 2bac952
Showing
2 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,38 @@ | ||
# This workflow helps with creating releases. | ||
# This job will only be triggered when a tag (vX.X.x) is pushed | ||
name: Release | ||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.17 | ||
- name: Set Env | ||
run: echo "TM_VERSION=$(go list -m github.com/tendermint/tendermint | sed 's:.* ::')" >> $GITHUB_ENV | ||
- name: Build | ||
uses: goreleaser/goreleaser-action@v2 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
with: | ||
version: latest | ||
args: build --rm-dist --skip-validate # skip validate skips initial sanity checks in order to be able to fully run | ||
env: | ||
TM_VERSION: ${{ env.TM_VERSION }} | ||
- name: Release | ||
uses: goreleaser/goreleaser-action@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
version: latest | ||
args: release --rm-dist --release-notes ./RELEASE_NOTES.md | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TM_VERSION: ${{ env.TM_VERSION }} |
This file contains 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,56 @@ | ||
--- | ||
project_name: gaia | ||
|
||
env: | ||
- GO111MODULE=on | ||
|
||
before: | ||
hooks: | ||
- go mod tidy -compat=1.17 | ||
|
||
builds: | ||
- main: ./cmd/gaiad | ||
id: "gaiad" | ||
binary: gaiad | ||
mod_timestamp: "{{ .CommitTimestamp }}" | ||
flags: | ||
- -tags=netgo ledger | ||
- -trimpath | ||
env: | ||
- CGO_ENABLED=0 | ||
ldflags: | ||
- -s -w -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X github.com/cosmos/cosmos-sdk/version.Name=gaia -X github.com/cosmos/cosmos-sdk/version.AppName=gaiad -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 -X github.com/tendermint/tendermint/version.TMCoreSemVer={{ .Env.TM_VERSION }} | ||
goos: | ||
- darwin | ||
- linux | ||
- windows | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
|
||
archives: | ||
- format: tar.gz | ||
wrap_in_directory: "true" | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
name_template: "{{ .Binary }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" | ||
files: | ||
- LICENSE | ||
- README.md | ||
|
||
release: | ||
github: | ||
owner: cosmos | ||
name: gaia | ||
name_template: "v{{.Version}}" | ||
|
||
checksum: | ||
name_template: SHA256SUMS-v{{.Version}}.txt | ||
algorithm: sha256 | ||
|
||
snapshot: | ||
name_template: SNAPSHOT-{{ .Commit }} | ||
|
||
changelog: | ||
skip: true |