diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 205994bf..8d988660 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,17 +19,20 @@ jobs: fetch-depth: 0 - run: git fetch --force --tags + - name: Set go version + run: echo "GO_VERSION=$(make print_required_go_version)" >> $GITHUB_ENV + - uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version: "${{ env.GO_VERSION }}" - name: Set Env - run: echo "TM_VERSION=$(go list -m github.com/tendermint/tendermint | sed 's:.* ::')" >> $GITHUB_ENV + run: echo "TM_VERSION=$(go list -m github.com/cometbft/cometbft | sed 's:.* ::')" >> $GITHUB_ENV - name: Release uses: goreleaser/goreleaser-action@v5 with: version: latest - args: release --clean --release-notes ./RELEASE_NOTES.md + args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index 51d5da2d..98476c7e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -53,7 +53,7 @@ snapshot: name_template: "{{ .Version }}-{{ .ShortCommit }}" changelog: - skip: false + disable: true git: # What should be used to sort tags when gathering the current and previous diff --git a/Makefile b/Makefile index 2873caa1..2d44a0a6 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,8 @@ DOCKER := $(shell which docker) BUILDDIR ?= $(CURDIR)/build TEST_DOCKER_REPO=cosmos/contrib-atomonetest -GO_SYSTEM_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1-2) -REQUIRE_GO_VERSION = 1.21 +GO_SYSTEM_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1) +REQUIRE_GO_VERSION = 1.21.13 export GO111MODULE = on export CGO_ENABLED = 0 @@ -97,9 +97,17 @@ include contrib/devtools/Makefile ### Build ### ############################################################################### +print_required_go_version: + @echo $(REQUIRE_GO_VERSION) + check_version: ifneq ($(GO_SYSTEM_VERSION), $(REQUIRE_GO_VERSION)) - @echo "ERROR: Go version $(REQUIRE_GO_VERSION) is required for $(VERSION) of AtomOne." + @echo 'ERROR: Go version $(REQUIRE_GO_VERSION) is required for building AtomOne' + @echo '--> You can install it using:' + @echo 'go install golang.org/dl/go$(REQUIRE_GO_VERSION)@latest && go$(REQUIRE_GO_VERSION) download' + @echo '--> Then prefix your make command with:' + @echo 'GOROOT=$$(go$(REQUIRE_GO_VERSION) env GOROOT) PATH=$$GOROOT/bin:$$PATH' + exit 1 endif all: install lint run-tests test-e2e vulncheck @@ -111,6 +119,10 @@ build: BUILD_ARGS=-o $(BUILDDIR)/ $(BUILD_TARGETS): check_version go.sum $(BUILDDIR)/ go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./... +build-ledger: go.sum $(BUILDDIR)/ + @echo "WARNING: Ledger build involves enabling cgo, which disables the ability to have reproducible builds." + CGO_ENABLED=1 go build -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) -o $(BUILDDIR)/ ./... + $(BUILDDIR)/: mkdir -p $(BUILDDIR)/ diff --git a/README.md b/README.md index 267d2cec..abf43b50 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,19 @@ The following modifications have been made to the Cosmos Hub software to create 5. Changed Bech32 prefixes to `atone` (see `cmd/atomoned/cmd/config.go`) 6. Removed ability for validators to vote on proposals with delegations, they can only use their own stake -## Reproducible builds (TODO) +## Reproducible builds An effort has been made to make it possible to build the exact same binary -locally as the Github Release section. To do this, checkout to the expected -version and then simply run `make build` (which will output the binary to the -`build` directory) or `make install`. The resulted binary should have the same -sha256 hash than the one from the Github Release section. +locally as the Github Release section. To do this: +- Checkout to the expected released version +- Run `make build` (which will output the binary to the `build` directory) or +`make install`. Note that a fixed version of the `go` binary is required, +follow the command instructions to install this specific version if needed. +- The resulted binary should have the same sha256 hash than the one from the +Github Release section. + +## Ledger support + +Run `make build-ledger` to have ledger support in `./build/atomoned` binary. +Note that this will disable reproducible builds, as it introduces OS +dependencies.