From 756c106a1eb046249ca9f2ad458767d291659b19 Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Tue, 25 Jun 2024 23:04:11 +0900 Subject: [PATCH 1/6] bug: Fix goreleaser config --- .github/workflows/tag.yml | 6 +-- .goreleaser.yml | 3 ++ Makefile | 83 +++++++++++++++++++-------------------- 3 files changed, 45 insertions(+), 47 deletions(-) diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 6e9feb7be7..0ad318e07c 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -12,12 +12,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - run: git fetch --force --tags - - name: Build & Publish release + - name: Build & publish release run: | make release env: - GORELEASER_MOUNT_CONFIG: true - GORELEASER_IMAGE: line/goreleaserx:1.13.1-1.19.3 - GORELEASER_RELEASE: true GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml index 5ee34e76f1..8d2328ad87 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,6 @@ +project_name: fnsa-simd +version: 2 + before: hooks: - go mod tidy diff --git a/Makefile b/Makefile index f42e8e834b..f671757b14 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,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 @@ -91,6 +92,7 @@ ldflags = -X github.com/Finschia/finschia-sdk/version.Name=sim \ -X github.com/Finschia/finschia-sdk/types.DBBackend=$(DB_BACKEND) \ -X "github.com/Finschia/finschia-sdk/version.BuildTags=$(build_tags_comma_sep)" + ifeq (,$(findstring nostrip,$(LBM_BUILD_OPTIONS))) ldflags += -w -s endif @@ -526,62 +528,59 @@ error-doc-gen: .PHONY: error-doc-gen ############################################################################### -### release ### +### Release ### ############################################################################### -GORELEASER_CONFIG ?= .goreleaser.yml - -GORELEASER_BUILD_LDF = $(ldflags) -GORELEASER_BUILD_LDF := $(strip $(GORELEASER_BUILD_LDF)) +GORELEASER_IMAGE := goreleaser/goreleaser-cross:v$(GO_VERSION) +PACKAGE_NAME := github.com/Finschia/finschia-sdk -GORELEASER_SKIP_VALIDATE ?= false -GORELEASER_DEBUG ?= false -GORELEASER_IMAGE ?= line/goreleaserx:1.13.1-1.19.3 -GORELEASER_RELEASE ?= false -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) \ + -e OST_VERSION=$(OST_VERSION) \ + -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 \ else - GORELEASER_SKIP_PUBLISH := --skip-publish=true - GORELEASER_SKIP_VALIDATE ?= false - GITHUB_TOKEN= -endif - -ifeq ($(GORELEASER_MOUNT_CONFIG),true) - GORELEASER_IMAGE := -v $(HOME)/.docker/config.json:/root/.docker/config.json $(GORELEASER_IMAGE) +release: + @echo "Error: GITHUB_TOKEN is not defined. Please define it before running 'make release'." endif -release-snapshot: +release-dry-run: 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) \ - build --snapshot \ - -f "$(GORELEASER_CONFIG)" \ - --skip-validate=$(GORELEASER_SKIP_VALIDATE) \ - --debug=$(GORELEASER_DEBUG) \ - --rm-dist + release \ + --clean \ + --skip=validate --skip=publish --skip=announce \ + --verbose -release: +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) \ - $(GORELEASER_SKIP_PUBLISH) \ - -f "$(GORELEASER_CONFIG)" \ - --skip-validate=$(GORELEASER_SKIP_VALIDATE) \ - --skip-announce=true \ - --debug=$(GORELEASER_DEBUG) \ - --rm-dist - -.PHONY: release-snapshot release + release \ + --clean \ + --snapshot \ + --skip=publish --skip=announce + +.PHONY: release release-dry-run release-snapshot From 6aae6702667367d9541189d2c1b562fbd9d4ef29 Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Wed, 26 Jun 2024 10:54:41 +0900 Subject: [PATCH 2/6] Remove hardcoding var --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f671757b14..3202d40aa9 100644 --- a/Makefile +++ b/Makefile @@ -532,7 +532,7 @@ error-doc-gen: ############################################################################### GORELEASER_IMAGE := goreleaser/goreleaser-cross:v$(GO_VERSION) -PACKAGE_NAME := github.com/Finschia/finschia-sdk +PACKAGE_NAME := $(shell grep "^module" go.mod | cut -d' ' -f2) ifdef GITHUB_TOKEN release: From 22c13b558df36b725b2fd131f18aae250847c57b Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Wed, 26 Jun 2024 10:56:47 +0900 Subject: [PATCH 3/6] Add CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e638d0a0ec..5a67eb1762 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,6 +99,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (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 ### Removed From 7bade8e6d29b268a3ac6dccc03edd42c3339bd72 Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Wed, 26 Jun 2024 13:38:34 +0900 Subject: [PATCH 4/6] Modify release config --- .goreleaser.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 8d2328ad87..ef84f99ccb 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,4 +1,4 @@ -project_name: fnsa-simd +project_name: finschia-sdk version: 2 before: @@ -98,7 +98,8 @@ checksum: snapshot: name_template: "{{ incpatch .Version }}-next" changelog: - use: git + use: github + format: "{{.Message}}" sort: asc groups: - title: "Breaking Changes" @@ -129,7 +130,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 From a21879da0487b671c52f6c32143d8152be270bf7 Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Wed, 26 Jun 2024 16:38:58 +0900 Subject: [PATCH 5/6] Exclude irrelevant commit and include missing commit --- .goreleaser.yml | 17 +++++++++-------- Makefile | 8 +++----- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index ef84f99ccb..e2b66ecf4c 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -106,22 +106,23 @@ changelog: 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: diff --git a/Makefile b/Makefile index 3202d40aa9..c32a0279cc 100644 --- a/Makefile +++ b/Makefile @@ -542,14 +542,13 @@ release: -e GITHUB_TOKEN="$(GITHUB_TOKEN)" \ --platform linux/amd64 \ -e GITHUB_TOKEN=$(GITHUB_TOKEN) \ - -e OST_VERSION=$(OST_VERSION) \ -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 \ + --skip=announce else release: @echo "Error: GITHUB_TOKEN is not defined. Please define it before running 'make release'." @@ -566,7 +565,7 @@ release-dry-run: $(GORELEASER_IMAGE) \ release \ --clean \ - --skip=validate --skip=publish --skip=announce \ + --skip=publish --skip=announce --skip=validate \ --verbose release-snapshot: @@ -580,7 +579,6 @@ release-snapshot: $(GORELEASER_IMAGE) \ release \ --clean \ - --snapshot \ - --skip=publish --skip=announce + --snapshot .PHONY: release release-dry-run release-snapshot From 104085299ad616163609ff7005223e30498dc32b Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Thu, 27 Jun 2024 19:40:55 +0900 Subject: [PATCH 6/6] chore --- .github/workflows/tag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 0ad318e07c..228fd75bfc 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -16,4 +16,4 @@ jobs: run: | make release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}