Skip to content
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

chore: release workflow setup #1409

Merged
merged 3 commits into from
May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
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 }}
56 changes: 56 additions & 0 deletions .goreleaser.yml
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