From 2530ac62ef62f3a03c44aac1d0b98ecf6bfdf557 Mon Sep 17 00:00:00 2001 From: Jaeseung Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:16:18 +0900 Subject: [PATCH] bug: Fix goreleaser config (#1431) * bug: Fix goreleaser config * Remove hardcoding var * Add CHANGELOG * Modify release config * Exclude irrelevant commit and include missing commit (cherry picked from commit 8e266d837ca4dd7704248de04c8f951138cfe60d) # Conflicts: # .github/workflows/tag.yml # CHANGELOG.md # Makefile --- .github/workflows/tag.yml | 9 ++++-- .goreleaser.yml | 28 +++++++++++------- CHANGELOG.md | 32 +++++++++++++++++++++ Makefile | 60 ++++++++++++++++++++++++++++++++------- 4 files changed, 105 insertions(+), 24 deletions(-) diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index e3be282908..0c2df32287 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -12,12 +12,15 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - run: git fetch --force --tags - - name: Build & Publish release + - name: Build & publish release run: | make release env: +<<<<<<< HEAD GORELEASER_MOUNT_CONFIG: true GORELEASER_IMAGE: goreleaser/goreleaser-cross:v1.21-v1.20.0 GORELEASER_RELEASE: true - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +======= + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +>>>>>>> 8e266d837 (bug: Fix goreleaser config (#1431)) diff --git a/.goreleaser.yml b/.goreleaser.yml index 5ee34e76f1..e2b66ecf4c 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,6 @@ +project_name: finschia-sdk +version: 2 + before: hooks: - go mod tidy @@ -95,29 +98,31 @@ checksum: snapshot: name_template: "{{ incpatch .Version }}-next" changelog: - use: git + use: github + format: "{{.Message}}" sort: asc groups: - title: "Breaking Changes" regexp: '^.*?BREAKING CHANGE(\([[:word:]]+\))??!?:.+$' order: 0 - title: Features - regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$' + regexp: '^.*?feat(\([^)]*\))?!?:.+$' order: 1 - title: 'Bug Fixes' - regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$' + regexp: '^.*?fix(\([^)]*\))?!?:.+$' order: 2 - title: 'Build, CI' - regexp: '^.*?(ci|build)(\([[:word:]]+\))??!?:.+$' + regexp: '^.*?(ci|build)(\([^)]*\))?!?:.+$' order: 3 - - title: 'Document Updates' - regexp: '^.*?docs(\([[:word:]]+\))??!?:.+$' - order: 4 - title: Improvements - regexp: '^.*?(test|refactor|perf)(\([[:word:]]+\))??!?:.+$' + regexp: '^.*?(test|refactor|perf)(\([^)]*\))?!?:.+$' + order: 4 + - title: 'Document Updates' + regexp: '^.*?docs(\([^)]*\))?!?:.+$' order: 5 - title: Others - order: 999 + regexp: '^.*?(chore|style|revert)(\([^)]*\))?!?:.+$' + order: 6 release: github: @@ -126,7 +131,10 @@ release: prerelease: auto mode: replace draft: false - + header: | + # Release {{ .Version }} ({{ .Date }}) + footer: | + **Full Changelog**: https://github.com/Finschia/finschia-sdk/compare/{{ .PreviousTag }}...{{ .CurrentTag }} # modelines, feel free to remove those if you don't want/use them: # yaml-language-server: $schema=https://goreleaser.com/static/schema.json diff --git a/CHANGELOG.md b/CHANGELOG.md index f61bc7821f..d409613fdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,38 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/fbridge) [\#1430](https://github.com/Finschia/finschia-sdk/pull/1430) Add CLI, gRPC, MsgServer tests ### Bug Fixes +<<<<<<< HEAD +======= +* chore(deps) [\#1141](https://github.com/Finschia/finschia-sdk/pull/1141) Bump github.com/cosmos/ledger-cosmos-go from 0.12.2 to 0.13.2 to fix ledger signing issue +* (x/auth, x/slashing) [\#1179](https://github.com/Finschia/finschia-sdk/pull/1179) modify missing changes of converting to tendermint +* (x/auth) [#1274](https://github.com/Finschia/finschia-sdk/pull/1274) `ModuleAccount.Validate` now reports a nil `.BaseAccount` instead of panicking. +* (x/collection) [\#1276](https://github.com/Finschia/finschia-sdk/pull/1276) eliminates potential risk for Insufficient Sanity Check of tokenID in Genesis +* (x/foundation) [\#1277](https://github.com/Finschia/finschia-sdk/pull/1277) add init logic of foundation module accounts to InitGenesis in order to eliminate potential panic +* (x/collection, x/token) [\#1288](https://github.com/Finschia/finschia-sdk/pull/1288) use accAddress to compare in validatebasic function in collection & token modules +* (x/collection) [\#1268](https://github.com/Finschia/finschia-sdk/pull/1268) export x/collection params into genesis +* (x/collection) [\#1294](https://github.com/Finschia/finschia-sdk/pull/1294) reject NFT coins on FT APIs +* (sec) [\#1302](https://github.com/Finschia/finschia-sdk/pull/1302) remove map iteration non-determinism with keys + sorting +* (client) [\#1303](https://github.com/Finschia/finschia-sdk/pull/1303) fix possible overflow in BuildUnsignedTx +* (types) [\#1299](https://github.com/Finschia/finschia-sdk/pull/1299) add missing nil checks +* (x/staking) [\#1301](https://github.com/Finschia/finschia-sdk/pull/1301) Use bytes instead of string comparison in delete validator queue (backport cosmos/cosmos-sdk#12303) +* (x/gov) [\#1304](https://github.com/Finschia/finschia-sdk/pull/1304) fetch a failed proposal tally from proposal.FinalTallyResult in the gprc query +* (x/staking) [\#1306](https://github.com/Finschia/finschia-sdk/pull/1306) add validation for potential slashing evasion during re-delegation +* (client/keys) [#1312](https://github.com/Finschia/finschia-sdk/pull/1312) ignore error when key not found in `keys delete` +* (store) [\#1310](https://github.com/Finschia/finschia-sdk/pull/1310) fix app-hash mismatch if upgrade migration commit is interrupted(backport cosmos/cosmos-sdk#13530) +* (types) [\#1313](https://github.com/Finschia/finschia-sdk/pull/1313) fix correctly coalesce coins even with repeated denominations(backport cosmos/cosmos-sdk#13265) +* (x/crypto) [\#1316](https://github.com/Finschia/finschia-sdk/pull/1316) error if incorrect ledger public key (backport cosmos/cosmos-sdk#14460, cosmos/cosmos-sdk#19691) +* (x/auth) [#1319](https://github.com/Finschia/finschia-sdk/pull/1319) prevent signing from wrong key in multisig +* (x/mint, x/slashing) [\#1323](https://github.com/Finschia/finschia-sdk/pull/1323) add missing nil check for params validation +* (x/server) [\#1337](https://github.com/Finschia/finschia-sdk/pull/1337) fix panic when defining minimum gas config as `100stake;100uatom`. Use a `,` delimiter instead of `;`. Fixes the server config getter to use the correct delimiter (backport cosmos/cosmos-sdk#18537) +* (x/fbridge) [\#1361](https://github.com/Finschia/finschia-sdk/pull/1361) Fixes fbridge auth checking bug +* (x/fswap) [\#1365](https://github.com/Finschia/finschia-sdk/pull/1365) fix update swap keys for possibly overlapped keys(`(hello,world) should be different to (hel,loworld)`) +* (x/fswap, x/fbridge) [\#1378](https://github.com/Finschia/finschia-sdk/pull/1378) Fix bug where amino is not supported in fswap and fbridge +* (x/fswap) [\#1379](https://github.com/Finschia/finschia-sdk/pull/1379) add missing router registration +* (x/fswap) [\#1385](https://github.com/Finschia/finschia-sdk/pull/1385) add accidentally deleted event emissions(EventSetSwap, EventAddDenomMetadata) +* (x/fswap) [\#1392](https://github.com/Finschia/finschia-sdk/pull/1392) fix dummy denom coin data for test in fswap +* (style) [\#1414](https://github.com/Finschia/finschia-sdk/pull/1414) improve code quality with new linters +* (ci) [\#1431](https://github.com/Finschia/finschia-sdk/pull/1431) Fix goreleaser config and replace deprecated docker image with official one +>>>>>>> 8e266d837 (bug: Fix goreleaser config (#1431)) ### Removed diff --git a/Makefile b/Makefile index 8d8539b4a7..ed21b38708 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ DOCKER := $(shell which docker) DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf CGO_ENABLED ?= 1 ARCH ?= x86_64 +GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2) export GO111MODULE = on @@ -93,6 +94,7 @@ ldflags = -X github.com/Finschia/finschia-sdk/version.Name=sim \ -X "github.com/Finschia/finschia-sdk/version.BuildTags=$(build_tags_comma_sep)" \ -X github.com/Finschia/ostracon/version.OCCoreSemVer=$(OCVERSION) + ifeq (,$(findstring nostrip,$(LBM_BUILD_OPTIONS))) ldflags += -w -s endif @@ -538,11 +540,13 @@ error-doc-gen: .PHONY: error-doc-gen ############################################################################### -### release ### +### Release ### ############################################################################### -GORELEASER_CONFIG ?= .goreleaser.yml +GORELEASER_IMAGE := goreleaser/goreleaser-cross:v$(GO_VERSION) +PACKAGE_NAME := $(shell grep "^module" go.mod | cut -d' ' -f2) +<<<<<<< HEAD GORELEASER_BUILD_LDF = $(ldflags) GORELEASER_BUILD_LDF := $(strip $(GORELEASER_BUILD_LDF)) @@ -555,25 +559,52 @@ GO_MOD_NAME := github.com/Finschia/finschia-sdk ifeq ($(GORELEASER_RELEASE),true) GORELEASER_SKIP_VALIDATE := false GORELEASER_SKIP_PUBLISH := release --skip-publish=false +======= +ifdef GITHUB_TOKEN +release: + docker run --rm \ + -e BUILD_TAGS="$(build_tags)" \ + -e BUILD_VARS='$(ldflags)' \ + -e GITHUB_TOKEN="$(GITHUB_TOKEN)" \ + --platform linux/amd64 \ + -e GITHUB_TOKEN=$(GITHUB_TOKEN) \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v `pwd`:/go/src/$(PACKAGE_NAME) \ + -w /go/src/$(PACKAGE_NAME) \ + $(GORELEASER_IMAGE) \ + release \ + --clean \ + --skip=announce +>>>>>>> 8e266d837 (bug: Fix goreleaser config (#1431)) else - GORELEASER_SKIP_PUBLISH := --skip-publish=true - GORELEASER_SKIP_VALIDATE ?= false - GITHUB_TOKEN= +release: + @echo "Error: GITHUB_TOKEN is not defined. Please define it before running 'make release'." endif -ifeq ($(GORELEASER_MOUNT_CONFIG),true) - GORELEASER_IMAGE := -v $(HOME)/.docker/config.json:/root/.docker/config.json $(GORELEASER_IMAGE) -endif +release-dry-run: + docker run --rm \ + -e BUILD_TAGS="$(build_tags)" \ + -e BUILD_VARS='$(ldflags)' \ + -e GITHUB_TOKEN="$(GITHUB_TOKEN)" \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v `pwd`:/go/src/$(PACKAGE_NAME) \ + -w /go/src/$(PACKAGE_NAME) \ + $(GORELEASER_IMAGE) \ + release \ + --clean \ + --skip=publish --skip=announce --skip=validate \ + --verbose release-snapshot: docker run --rm \ -e BUILD_TAGS="$(build_tags)" \ - -e BUILD_VARS='$(GORELEASER_BUILD_LDF)' \ + -e BUILD_VARS='$(ldflags)' \ -e GITHUB_TOKEN="$(GITHUB_TOKEN)" \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v $(shell pwd):/go/src/$(GO_MOD_NAME) \ - -w /go/src/$(GO_MOD_NAME) \ + -v `pwd`:/go/src/$(PACKAGE_NAME) \ + -w /go/src/$(PACKAGE_NAME) \ $(GORELEASER_IMAGE) \ +<<<<<<< HEAD build --snapshot \ -f "$(GORELEASER_CONFIG)" \ --skip-validate=$(GORELEASER_SKIP_VALIDATE) \ @@ -597,3 +628,10 @@ release: --clean .PHONY: release-snapshot release +======= + release \ + --clean \ + --snapshot + +.PHONY: release release-dry-run release-snapshot +>>>>>>> 8e266d837 (bug: Fix goreleaser config (#1431))