diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc588dac..6e08d182 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,4 +23,4 @@ jobs: sudo rm -rf dist make release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GHCR_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index d944b728..05a2d264 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,108 +1,198 @@ -before: - hooks: - - go mod download - +project_name: sided +env: + - CGO_ENABLED=1 builds: - - id: "sidechaind-darwin" - main: ./cmd/sidechaind - binary: bin/sidechaind + - id: sided-darwin-amd64 + main: ./cmd/sided/main.go + binary: sided + hooks: + pre: + - wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvmstatic_darwin.a -O /lib/libwasmvmstatic_darwin.a env: - - CGO_ENABLED=1 - CC=o64-clang - - CXX=o64-clang++ + - CGO_LDFLAGS=-L/lib goos: - darwin goarch: - amd64 flags: - - -tags=cgo + - -mod=readonly + - -trimpath ldflags: - - -s -w -X github.com/cosmos/cosmos-sdk/version.Name=sidechain -X github.com/cosmos/cosmos-sdk/version.AppName=sidechaind -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}} - - id: "sidechaind-darwin-arm64" - main: ./cmd/sidechaind - binary: bin/sidechaind + - -X github.com/cosmos/cosmos-sdk/version.Name=elys + - -X github.com/cosmos/cosmos-sdk/version.AppName=sided + - -X github.com/cosmos/cosmos-sdk/version.Version=v{{ .Version }} + - -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }} + - -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,static_wasm + - -w -s + - -linkmode=external + tags: + - netgo + - ledger + - static_wasm + - id: sided-darwin-arm64 + main: ./cmd/sided/main.go + binary: sided + hooks: + pre: + - wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvmstatic_darwin.a -O /lib/libwasmvmstatic_darwin.a env: - - CGO_ENABLED=1 - CC=oa64-clang - - CXX=oa64-clang++ + - CGO_LDFLAGS=-L/lib goos: - darwin goarch: - arm64 flags: - - -tags=cgo + - -mod=readonly + - -trimpath ldflags: - - -s -w -X github.com/cosmos/cosmos-sdk/version.Name=sidechain -X github.com/cosmos/cosmos-sdk/version.AppName=sidechaind -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}} - - id: "sidechaind-linux" - main: ./cmd/sidechaind - binary: bin/sidechaind - env: - - CGO_ENABLED=1 - - CC=gcc - - CXX=g++ + - -X github.com/cosmos/cosmos-sdk/version.Name=elys + - -X github.com/cosmos/cosmos-sdk/version.AppName=sided + - -X github.com/cosmos/cosmos-sdk/version.Version=v{{ .Version }} + - -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }} + - -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,static_wasm + - -w -s + - -linkmode=external + tags: + - netgo + - ledger + - static_wasm + - id: sided-linux-amd64 + main: ./cmd/sided + binary: sided + hooks: + pre: + - wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvm_muslc.x86_64.a -O /usr/lib/x86_64-linux-gnu/libwasmvm_muslc.a goos: - linux goarch: - amd64 + env: + - CC=x86_64-linux-gnu-gcc flags: - - -tags=cgo + - -mod=readonly + - -trimpath ldflags: - - -s -w -X github.com/cosmos/cosmos-sdk/version.Name=sidechain -X github.com/cosmos/cosmos-sdk/version.AppName=sidechaind -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}} - - id: "sidechaind-linux-arm64" - main: ./cmd/sidechaind - binary: bin/sidechaind - env: - - CGO_ENABLED=1 - - CC=aarch64-linux-gnu-gcc - - CXX=aarch64-linux-gnu-g++ + - -X github.com/cosmos/cosmos-sdk/version.Name=elys + - -X github.com/cosmos/cosmos-sdk/version.AppName=sided + - -X github.com/cosmos/cosmos-sdk/version.Version=v{{ .Version }} + - -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }} + - -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc,osusergo + - -w -s + - -linkmode=external + - -extldflags '-Wl,-z,muldefs -static -lm' + tags: + - netgo + - ledger + - muslc + - osusergo + - id: sided-linux-arm64 + main: ./cmd/sided + binary: sided + hooks: + pre: + - wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvm_muslc.aarch64.a -O /usr/lib/aarch64-linux-gnu/libwasmvm_muslc.a goos: - linux goarch: - arm64 - flags: - - -tags=cgo - ldflags: - - -s -w -X github.com/cosmos/cosmos-sdk/version.Name=sidechain -X github.com/cosmos/cosmos-sdk/version.AppName=sidechaind -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}} - - id: "sidechaind-windows" - main: ./cmd/sidechaind - binary: bin/sidechaind env: - - CGO_ENABLED=1 - - CC=x86_64-w64-mingw32-gcc - - CXX=x86_64-w64-mingw32-g++ - goos: - - windows - goarch: - - amd64 + - CC=aarch64-linux-gnu-gcc flags: - - -tags=cgo - - -buildmode=exe + - -mod=readonly + - -trimpath ldflags: - - -s -w -X github.com/cosmos/cosmos-sdk/version.Name=sidechain -X github.com/cosmos/cosmos-sdk/version.AppName=sidechaind -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.Name=elys + - -X github.com/cosmos/cosmos-sdk/version.AppName=sided + - -X github.com/cosmos/cosmos-sdk/version.Version=v{{ .Version }} + - -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }} + - -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc,osusergo + - -w -s + - -linkmode=external + - -extldflags '-Wl,-z,muldefs -static -lm' + tags: + - netgo + - ledger + - muslc + - osusergo +universal_binaries: + - id: sided-darwin-universal + ids: + - sided-darwin-amd64 + - sided-darwin-arm64 + replace: false archives: -- name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' - replacements: - darwin: Darwin - linux: Linux - windows: Windows - format_overrides: - - goos: windows - format: zip - builds: - - sidechaind-darwin - - sidechaind-darwin-arm64 - - sidechaind-windows - - sidechaind-linux - - sidechaind-linux-arm64 - + - id: zipped + builds: + - sided-darwin-universal + - sided-linux-amd64 + - sided-linux-arm64 + - sided-darwin-amd64 + - sided-darwin-arm64 + name_template: "{{.ProjectName}}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}" + format: tar.gz + files: + - none* + - id: binaries + builds: + - sided-darwin-universal + - sided-linux-amd64 + - sided-linux-arm64 + - sided-darwin-amd64 + - sided-darwin-arm64 + name_template: "{{.ProjectName}}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}" + format: binary + files: + - none* checksum: - name_template: 'checksums.txt' + name_template: "sha256sum.txt" + algorithm: sha256 +# Docs: https://goreleaser.com/customization/changelog/ changelog: - sort: asc - filters: - exclude: - - '^docs:' - - '^test:' -snapshot: - name_template: "{{ .Tag }}-next" + skip: true +# Docs: https://goreleaser.com/customization/release/ +release: + github: + owner: sideprotocol + name: sideprotocol + replace_existing_draft: true + header: | + ## Description + + < DESCRIPTION OF RELEASE > + + ## ⚡️ Binaries + + Binaries for Linux and Darwin (amd64 and arm64) are available below. + Darwin users can also use the same universal binary `sided-v{{ .Version }}-darwin-all` for both amd64 and arm64. + + #### 🔨 Build from source + + If you prefer to build from source, you can use the following commands: + + ````bash + git clone https://github.com/sideprotocol/side + cd elys && git checkout v{{ .Version }} + make install + ```` + + ## What's Changed + + See the full changelog [here](https://github.com/sideprotocol/side/blob/v{{ .Version }}/CHANGELOG.md) + name_template: "v{{.Version}}" + mode: replace + draft: true +# Docs: https://goreleaser.com/customization/announce/ +# We could automatically announce the release in +# - discord +# - slack +# - twitter +# - webhooks +# - telegram +# - reddit +# +# announce: +# discord: +# enabled: true +# message_template: 'New {{.Tag}} is out!' diff --git a/Makefile b/Makefile index 19d1889c..a76bc80f 100755 --- a/Makefile +++ b/Makefile @@ -504,8 +504,8 @@ localnet-show-logstream: ### Releasing ### ############################################################################### -PACKAGE_NAME:=github.com/sideprotocol/sidechain -GOLANG_CROSS_VERSION = v1.19 +PACKAGE_NAME:=github.com/sideprotocol/side +GOLANG_CROSS_VERSION = v1.20 GOPATH ?= '$(HOME)/go' release-dry-run: docker run \