Skip to content

Commit

Permalink
chore: release workflow setup (#1409)
Browse files Browse the repository at this point in the history
* updates

* updates

* updates
  • Loading branch information
alexanderbez authored May 20, 2022
1 parent ee5bf99 commit 2bac952
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
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

0 comments on commit 2bac952

Please sign in to comment.