Skip to content

Commit

Permalink
chore: add release gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
JeancarloBarrios committed Oct 6, 2023
1 parent 51e752c commit a2e11a3
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 1 deletion.
46 changes: 46 additions & 0 deletions .github/workflows/realease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# triggered when a semantic version tag is pushed (vX.X.X)
name: Release
on:
push:
tags:
- "*"
- "v[0-9]+\\.[0-9]+\\.[0-9]+-alpha[0-9]+" # vX.X.X-alphaX
- "v[0-9]+\\.[0-9]+\\.[0-9]+-beta[0-9]+" # vX.X.X-betaX
- "v[0-9]+\\.[0-9]+\\.[0-9]+-rc[0-9]+" # vX.X.X-rcX
- "v[0-9]+\\.[0-9]+\\.[0-9]+" # vX.X.X
concurrency:
group: ci-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: "1.21"
cache: true

- name: Set ENV
run: echo "COMET_VERSION=$(go list -m github.com/cometbft/cometbft | sed 's:.* ::')" >> $GITHUB_ENV

- name: goreleaser test-build
uses: goreleaser/goreleaser-action@v5
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Enable:ReleaseBuild')
with:
version: latest
args: build --clean --skip=validate
env:
COMET_VERSION: ${{ env.COMET_VERSION }}
- name: Release
uses: goreleaser/goreleaser-action@v5
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --clean --release-notes ./RELEASE_NOTES.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMET_VERSION: ${{ env.COMET_VERSION }}
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Tests / Code Coverage
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, labeled]
merge_group:
Expand Down Expand Up @@ -55,7 +58,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.19"
go-version: "1.21"
check-latest: true
cache: true
cache-dependency-path: go.sum
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ build/
.idea/
.vscode/
.DS_Store

dist/

/.act-event-file
50 changes: 50 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
project_name: seda

env:
- CGO_ENABLED=1
# - GOOS=linux # for local m1 mac run

before:
hooks:
- go mod download
- go mod tidy

builds:
- main: ./cmd/seda-chaind
id: "sedad"
binary: sedad
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -tags=badgerdb ledger netgo
- -trimpath
ldflags:
- -s -w -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X github.com/cosmos/cosmos-sdk/version.Name=seda-chain -X github.com/cosmos/cosmos-sdk/version.AppName=sedad-chain -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/cometbft/cometbft/version.TMCoreSemVer={{ .Env.COMET_VERSION }}
goos:
- linux
goarch:
- amd64
# - arm64 # github only supports linux @ amd64 :'(

archives:
- id: tarball
format: tar.gz
wrap_in_directory: false # must not wrap into directory to support cosmwasm
name_template: "{{ .Binary }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
files:
- LICENSE
- README.md

release:
github:
owner: sedaprotocol
name: seda

snapshot:
name_template: SNAPSHOT-{{ .Commit }}

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

changelog:
skip: false

0 comments on commit a2e11a3

Please sign in to comment.