Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

Commit aeb7e15

Browse files
authored
ci: update goreleaser (#604)
* ci: update goreleaser * bump version
1 parent 1894d22 commit aeb7e15

File tree

3 files changed

+66
-144
lines changed

3 files changed

+66
-144
lines changed

.github/workflows/goreleaser.yml

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,38 @@
1-
name: goreleaser
2-
1+
# This workflow helps with creating releases.
2+
# This job will only be triggered when a tag (vX.X.x) is pushed
3+
name: Release
34
on:
45
push:
6+
# Sequence of patterns matched against refs/tags
57
tags:
6-
- "v*.*.*"
8+
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
9+
710
jobs:
8-
goreleaser:
11+
release:
912
runs-on: ubuntu-latest
10-
environment: release
1113
steps:
1214
- uses: actions/checkout@v2
1315
with:
14-
submodules: true
15-
- name: Set up Go
16-
uses: actions/setup-go@v2
16+
fetch-depth: 0
17+
- uses: actions/setup-go@v2.1.4
1718
with:
1819
go-version: 1.17
19-
- name: release dry run
20-
run: make release-dry-run
21-
- name: setup release environment
20+
- name: Set Env
21+
run: echo "TM_VERSION=$(go list -m github.com/tendermint/tendermint | sed 's:.* ::')" >> $GITHUB_ENV
22+
- name: Build
23+
uses: goreleaser/goreleaser-action@v2.7.0
24+
if: ${{ github.event_name == 'pull_request' }}
25+
with:
26+
version: latest
27+
args: build --rm-dist --skip-validate # skip validate skips initial sanity checks in order to be able to fully run
28+
env:
29+
TM_VERSION: ${{ env.TM_VERSION }}
30+
- name: Release
31+
uses: goreleaser/goreleaser-action@v2
32+
if: startsWith(github.ref, 'refs/tags/')
33+
with:
34+
version: latest
35+
args: release --rm-dist --release-notes ./RELEASE_NOTES.md
2236
env:
2337
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24-
run: |-
25-
echo 'GITHUB_TOKEN=${{secrets.GITHUB_TOKEN}}' > .release-env
26-
- name: release publish
27-
run: make release
38+
TM_VERSION: ${{ env.TM_VERSION }}

.goreleaser.yml

Lines changed: 40 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,56 @@
1+
---
2+
project_name: ethermint
3+
4+
env:
5+
- GO111MODULE=on
6+
17
before:
28
hooks:
3-
- go mod download
9+
- go mod tidy
410

511
builds:
6-
- id: "ethermintd-darwin"
7-
main: ./cmd/ethermintd
8-
binary: bin/ethermintd
9-
env:
10-
- CGO_ENABLED=1
11-
- CC=o64-clang
12-
- CXX=o64-clang++
13-
goos:
14-
- darwin
15-
goarch:
16-
- amd64
12+
- main: ./cmd/ethermintd
13+
id: "ethermintd"
14+
binary: ethermintd
15+
mod_timestamp: "{{ .CommitTimestamp }}"
1716
flags:
18-
- -tags=cgo
19-
ldflags:
20-
- -s -w -X github.com/cosmos/cosmos-sdk/version.Name=ethermint -X github.com/cosmos/cosmos-sdk/version.AppName=ethermintd -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}}
21-
- id: "ethermintd-darwin-arm64"
22-
main: ./cmd/ethermintd
23-
binary: bin/ethermintd
17+
- -tags=netgo ledger
18+
- -trimpath
2419
env:
25-
- CGO_ENABLED=1
26-
- CC=oa64-clang
27-
- CXX=oa64-clang++
28-
goos:
29-
- darwin
30-
goarch:
31-
- arm64
32-
flags:
33-
- -tags=cgo
20+
- CGO_ENABLED=0
3421
ldflags:
35-
- -s -w -X github.com/cosmos/cosmos-sdk/version.Name=ethermint -X github.com/cosmos/cosmos-sdk/version.AppName=ethermintd -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}}
36-
- id: "ethermintd-linux"
37-
main: ./cmd/ethermintd
38-
binary: bin/ethermintd
39-
env:
40-
- CGO_ENABLED=1
41-
- CC=gcc
42-
- CXX=g++
22+
- -s -w -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X github.com/cosmos/cosmos-sdk/version.Name=ethermint -X github.com/cosmos/cosmos-sdk/version.AppName=ethermintd -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 }}
4323
goos:
24+
- darwin
4425
- linux
4526
goarch:
4627
- amd64
47-
flags:
48-
- -tags=cgo
49-
ldflags:
50-
- -s -w -X github.com/cosmos/cosmos-sdk/version.Name=ethermint -X github.com/cosmos/cosmos-sdk/version.AppName=ethermintd -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}}
51-
- id: "ethermintd-linux-arm64"
52-
main: ./cmd/ethermintd
53-
binary: bin/ethermintd
54-
env:
55-
- CGO_ENABLED=1
56-
- CC=aarch64-linux-gnu-gcc
57-
- CXX=aarch64-linux-gnu-g++
58-
goos:
59-
- linux
60-
goarch:
28+
- arm
6129
- arm64
62-
flags:
63-
- -tags=cgo
64-
ldflags:
65-
- -s -w -X github.com/cosmos/cosmos-sdk/version.Name=ethermint -X github.com/cosmos/cosmos-sdk/version.AppName=ethermintd -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}}
66-
- id: "ethermintd-windows"
67-
main: ./cmd/ethermintd
68-
binary: bin/ethermintd
69-
env:
70-
- CGO_ENABLED=1
71-
- CC=x86_64-w64-mingw32-gcc
72-
- CXX=x86_64-w64-mingw32-g++
73-
goos:
74-
- windows
75-
goarch:
76-
- amd64
77-
flags:
78-
- -tags=cgo
79-
- -buildmode=exe
80-
ldflags:
81-
- -s -w -X github.com/cosmos/cosmos-sdk/version.Name=ethermint -X github.com/cosmos/cosmos-sdk/version.AppName=ethermintd -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}}
8230

8331
archives:
84-
- name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
85-
replacements:
86-
darwin: Darwin
87-
linux: Linux
88-
windows: Windows
89-
amd64: x86_64
90-
format_overrides:
91-
- goos: windows
92-
format: zip
93-
builds:
94-
- ethermintd-darwin
95-
- ethermintd-darwin-arm64
96-
- ethermintd-windows
97-
- ethermintd-linux
98-
- ethermintd-linux-arm64
99-
32+
- format: tar.gz
33+
wrap_in_directory: true
34+
format_overrides:
35+
- goos: windows
36+
format: zip
37+
name_template: "{{ .Binary }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
38+
files:
39+
- LICENSE
40+
- README.md
41+
42+
release:
43+
github:
44+
owner: tharsis
45+
name: ethermint
46+
name_template: "v{{.Version}}"
47+
10048
checksum:
101-
name_template: 'checksums.txt'
102-
changelog:
103-
sort: asc
104-
filters:
105-
exclude:
106-
- '^docs:'
107-
- '^test:'
49+
name_template: SHA256SUMS-v{{.Version}}.txt
50+
algorithm: sha256
51+
10852
snapshot:
109-
name_template: "{{ .Tag }}-next"
53+
name_template: SNAPSHOT-{{ .Commit }}
54+
55+
changelog:
56+
skip: true

Makefile

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -498,39 +498,3 @@ localnet-show-logstream:
498498
docker-compose logs --tail=1000 -f
499499

500500
.PHONY: build-docker-local-ethermint localnet-start localnet-stop
501-
502-
###############################################################################
503-
### Releasing ###
504-
###############################################################################
505-
506-
PACKAGE_NAME:=github.com/tharsis/ethermint
507-
GOLANG_CROSS_VERSION = v1.17
508-
release-dry-run:
509-
docker run \
510-
--rm \
511-
--privileged \
512-
-e CGO_ENABLED=1 \
513-
-v /var/run/docker.sock:/var/run/docker.sock \
514-
-v `pwd`:/go/src/$(PACKAGE_NAME) \
515-
-v ${GOPATH}/pkg:/go/pkg \
516-
-w /go/src/$(PACKAGE_NAME) \
517-
troian/golang-cross:${GOLANG_CROSS_VERSION} \
518-
--rm-dist --skip-validate --skip-publish
519-
520-
release:
521-
@if [ ! -f ".release-env" ]; then \
522-
echo "\033[91m.release-env is required for release\033[0m";\
523-
exit 1;\
524-
fi
525-
docker run \
526-
--rm \
527-
--privileged \
528-
-e CGO_ENABLED=1 \
529-
--env-file .release-env \
530-
-v /var/run/docker.sock:/var/run/docker.sock \
531-
-v `pwd`:/go/src/$(PACKAGE_NAME) \
532-
-w /go/src/$(PACKAGE_NAME) \
533-
troian/golang-cross:${GOLANG_CROSS_VERSION} \
534-
release --rm-dist --skip-validate
535-
536-
.PHONY: release-dry-run release

0 commit comments

Comments
 (0)