Skip to content

Commit

Permalink
ci(release): release for linux and darwin (arm64 and amd64) (#1144)
Browse files Browse the repository at this point in the history
* ci(release): release for linux and darwin (arm64 and amd64)

* chore(goreleaser): add ledger support

* chore: update changelog

* chore: remove unnecessary replace directive in go.mod

---------

Co-authored-by: Kevin Yang <5478483+k-yang@users.noreply.github.com>
  • Loading branch information
helder-moreira and k-yang committed Feb 6, 2023
1 parent e2c76a8 commit cf3cc9e
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 27 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,7 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: '>=1.19.3'
cache: true

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

# More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs.
- uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
- run: make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TM_VERSION: ${{ env.TM_VERSION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 changes: 44 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,47 @@
before:
hooks:
- sudo wget https://github.com/CosmWasm/wasmvm/releases/download/v1.1.1/libwasmvm_muslc.x86_64.a -O /lib/libwasmvm_muslc.a
- sudo apt install musl-dev
project_name: nibid

env:
- CGO_ENABLED=1

builds:
- id: linux-amd64
- id: darwin
main: ./cmd/nibid
binary: nibid
goos:
- darwin
goarch:
- amd64
- arm64
env:
- CC=o64-clang
flags:
- -mod=readonly
ldflags:
- -s -w -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X github.com/cosmos/cosmos-sdk/version.Name=nibiru -X github.com/cosmos/cosmos-sdk/version.AppName=nibid -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }} -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }} -X github.com/tendermint/tendermint/version.TMCoreSemVer={{ .Env.TM_VERSION }}
- -linkmode=external
tags:
- netgo
- ledger
- static_wasm
overrides:
- goos: darwin
goarch: arm64
env:
- CC=oa64-clang

- id: linux
main: ./cmd/nibid
binary: nibid
hooks:
pre:
- wget https://github.com/CosmWasm/wasmvm/releases/download/v1.1.1/libwasmvm_muslc.x86_64.a -O /usr/lib/x86_64-linux-gnu/libwasmvm_muslc.a
- wget https://github.com/CosmWasm/wasmvm/releases/download/v1.1.1/libwasmvm_muslc.aarch64.a -O /usr/lib/aarch64-linux-gnu/libwasmvm_muslc.a
goos:
- linux
goarch:
- amd64
- arm64
env:
- CGO_ENABLED=1
- CC=x86_64-linux-gnu-gcc
flags:
- -mod=readonly
Expand All @@ -21,5 +51,13 @@ builds:
- -extldflags '-Wl,-z,muldefs -static -lm'
tags:
- netgo
- ledger
- muslc
overrides:
- goos: linux
goarch: arm64
env:
- CC=aarch64-linux-gnu-gcc

universal_binaries:
- id: darwin
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#1154](https://github.com/NibiruChain/nibiru/pull/1154) - refactor(asset-pair)!: refactors `common.AssetPair` as an extension of string
* [#1156](https://github.com/NibiruChain/nibiru/pull/1156) - refactor: remove lockup & incentivation module

### CI

* [#1032](https://github.com/NibiruChain/nibiru/pull/1107) - ci: Create e2e wasm contract test

### Improvements

* [#1161](https://github.com/NibiruChain/nibiru/pull/1161) - refactor: migrate simapp tests to use main app
Expand All @@ -71,6 +67,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#1145](https://github.com/NibiruChain/nibiru/pull/1145) - chore: add USD quote asset
* [#1160](https://github.com/NibiruChain/nibiru/pull/1160) - feat: generic set
* [#1139](https://github.com/NibiruChain/nibiru/pull/1139) - feat: add default oracle whitelisted pairs
* [#1032](https://github.com/NibiruChain/nibiru/pull/1107) - ci: Create e2e wasm contract test
* [#1144](https://github.com/NibiruChain/nibiru/pull/1144) - ci: release for linux and darwin (arm64 and amd64)
* [#1165](https://github.com/NibiruChain/nibiru/pull/1165) - chore(deps): bump cosmos-sdk to [v0.45.12](https://github.com/cosmos/cosmos-sdk/blob/release/v0.45.x/CHANGELOG.md#v04512---2023-01-23)
* [#1149](https://github.com/NibiruChain/nibiru/pull/1149) - chore(deps): Bump [github.com/btcsuite/btcd](https://github.com/btcsuite/btcd) from 0.22.1 to 0.22.2
* [#1089](https://github.com/NibiruChain/nibiru/pull/1089) - refactor(deps): Bump [github.com/holiman/uint256](https://github.com/holiman/uint256) from 1.1.1 to 1.2.1 (syntax changes)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ include contrib/make/mock.mk
include contrib/make/lint.mk
include contrib/make/test.mk
include contrib/make/simulation.mk

include contrib/make/release.mk

16 changes: 15 additions & 1 deletion contrib/make/release.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,19 @@
### Release ###
###############################################################################

PACKAGE_NAME := github.com/NibiruChain/nibiru
GOLANG_CROSS_VERSION ?= v1.19

release:
docker run --rm -v "$(CURDIR)":/code -w /code goreleaser/goreleaser-cross --skip-publish --rm-dist
docker run \
--rm \
--platform=linux/amd64 \
--privileged \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "$(CURDIR)":/go/src/$(PACKAGE_NAME) \
-w /go/src/$(PACKAGE_NAME) \
-e CGO_ENABLED=1 \
-e TM_VERSION=$(go list -m github.com/tendermint/tendermint | sed 's:.* ::') \
-e GITHUB_TOKEN=${GITHUB_TOKEN} \
goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
release --rm-dist
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,5 @@ replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alp
// Fix upstream GHSA-h395-qcrw-5vmq vulnerability.
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
replace github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0

replace github.com/CosmWasm/wasmvm v1.1.1 => github.com/NibiruChain/wasmvm v1.1.2
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQ
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
github.com/CosmWasm/wasmd v0.29.1 h1:uagvdFfNYzkxUurKmVooHqkPqWo0dF+KvAzgUt4aOn0=
github.com/CosmWasm/wasmd v0.29.1/go.mod h1:agYHzj3R0O+UExLHlXLuEfLqhIrCC+pF5ouAmbe9/68=
github.com/CosmWasm/wasmvm v1.1.1 h1:0xtdrmmsP9fibe+x42WcMkp5aQ738BICgcH3FNVLzm4=
github.com/CosmWasm/wasmvm v1.1.1/go.mod h1:ei0xpvomwSdONsxDuONzV7bL1jSET1M8brEx0FCXc+A=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg=
github.com/NibiruChain/collections v0.1.1 h1:6urGw4ephXwNKZ/cg6I5SGBBlIf9UPvRn6mFiAoX8Vk=
github.com/NibiruChain/collections v0.1.1/go.mod h1:uWw2HTT4NxQaqC6Wmwyqbz8Fg7bGShMjZUx5unWRLNk=
github.com/NibiruChain/wasmvm v1.1.2 h1:VoWMVI1XyIANgyS8u7Vbu2P8ziNiZnNe//giC4dv/aM=
github.com/NibiruChain/wasmvm v1.1.2/go.mod h1:ei0xpvomwSdONsxDuONzV7bL1jSET1M8brEx0FCXc+A=
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw=
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
Expand Down

0 comments on commit cf3cc9e

Please sign in to comment.