Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Fix goreleaser config (backport #1431) #1436

Open
wants to merge 1 commit into
base: release/v0.49.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
=======
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
>>>>>>> 8e266d837 (bug: Fix goreleaser config (#1431))
28 changes: 18 additions & 10 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
project_name: finschia-sdk
version: 2

before:
hooks:
- go mod tidy
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
60 changes: 49 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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))

Expand All @@ -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) \
Expand All @@ -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))
Loading