Skip to content

Commit

Permalink
Merge pull request #3 from warden-protocol/ci-enhancements
Browse files Browse the repository at this point in the history
feat: change goreleaser to use not goreleaser-cross
  • Loading branch information
jlehtimaki authored Oct 7, 2024
2 parents 8c5a372 + 964b1f9 commit 86f7aed
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 52 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build/
dist/
88 changes: 42 additions & 46 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,18 @@ before:
hooks:
- go mod tidy
builds:
- id: echo-linux-amd64
main: ./cmd/echo.go
binary: echo
- id: echo
env:
- CGO_ENABLED=0
main: ./cmd/
goos:
- linux
goarch:
- amd64
flags:
- -mod=readonly
- -trimpath
ldflags:
- -X main.version={{ .Version }}
- -X main.commit={{ .Commit }}
- -X main.date={{ .CommitDate }}

- id: echo-linux-arm64
main: ./cmd/echo.go
binary: echo
goos:
- linux
goarch:
- arm64
flags:
- -mod=readonly
- -trimpath
ldflags:
- -X main.version={{ .Version }}
- -X main.commit={{ .Commit }}
- -X main.date={{ .CommitDate }}

- id: echo-darwin-amd64
main: ./cmd/echo.go
binary: echo
goos:
- darwin
goarch:
- amd64
flags:
- -mod=readonly
- -trimpath
ldflags:
- -X main.version={{ .Version }}
- -X main.commit={{ .Commit }}
- -X main.date={{ .CommitDate }}

- id: echo-darwin-arm64
main: ./cmd/echo.go
binary: echo
goos:
- darwin
goarch:
- arm64
goarm:
- "7"
flags:
- -mod=readonly
- -trimpath
Expand All @@ -70,6 +30,42 @@ universal_binaries:
- echo-darwin-amd64
- echo-darwin-arm64
replace: false
checksum:
name_template: "checksums.txt"

changelog:
sort: asc
use: github
filters:
exclude:
- "^test:"
- "^test\\("
- "merge conflict"
- Merge pull request
- Merge remote-tracking branch
- Merge branch
- go mod tidy
groups:
- title: Dependency updates
regexp: '^.*?(.+)\(deps\)!?:.+$'
order: 300
- title: "New Features"
regexp: '^.*?feat(\(.+\))??!?:.+$'
order: 100
- title: "Security updates"
regexp: '^.*?sec(\(.+\))??!?:.+$'
order: 150
- title: "Bug fixes"
regexp: '^.*?(fix|refactor)(\(.+\))??!?:.+$'
order: 200
- title: "Documentation updates"
regexp: ^.*?docs?(\(.+\))??!?:.+$
order: 400
- title: "Build process updates"
regexp: ^.*?(build|ci)(\(.+\))??!?:.+$
order: 400
- title: Other work
order: 9999

dockers:
- use: buildx
Expand Down
17 changes: 11 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BUILD_FOLDER = build
DIST_FOLDER = dist
GORELEASER_VERSION = v1.22.2
GORELEASER_VERSION = v2.3.2
DOCKER := $(shell which docker)
PACKAGE_NAME = github.com/warden-protocol/echo

Expand Down Expand Up @@ -59,13 +59,16 @@ update:
release-dryrun:
$(DOCKER) run \
--rm \
-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/goreleaser-cross:$(GORELEASER_VERSION) \
--skip-publish \
--clean \
--skip-validate
--userns host \
--privileged \
ghcr.io/goreleaser/goreleaser:$(GORELEASER_VERSION) \
--skip=validate,publish \
--snapshot \
--clean

release:
$(DOCKER) run \
Expand All @@ -74,5 +77,7 @@ release:
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-w /go/src/$(PACKAGE_NAME) \
goreleaser/goreleaser-cross:$(GORELEASER_VERSION) \
--userns host \
--privileged \
ghcr.io/goreleaser/goreleaser:$(GORELEASER_VERSION) \
--clean

0 comments on commit 86f7aed

Please sign in to comment.