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

feature(releaser): better goreleaser with arm support and optimized AMD64 #428

Merged
merged 1 commit into from
Oct 1, 2024
Merged
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
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
with:
go-version: '1.23'

# Needed for ARM64 Docker builds
- name: Set up QEMU
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need qemu?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are building cross platform for docker, we need QEMU

Copy link
Collaborator

@dkropachev dkropachev Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a comment

uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down
61 changes: 54 additions & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,44 @@ version: 2

env:
- GO111MODULE=on
# ARM crypto extension for RANDOM Number generation
- GOARM64=v8.0,crypto
- CFLAGS="-O3"
- CXXFLAGS="-O3"

before:
hooks:
- go mod download

builds:
- id: gemini
ldflags: -s -w
main: ./cmd/gemini
env:
- env:
- CGO_ENABLED=0
goos:
- linux
ldflags: -s -w
goarch:
- amd64
- arm64
main: ./cmd/gemini
goamd64:
- v3 # v3 Enables AMD64 SIMD (SSE4.x,AVX2) optimizations

archives:
- name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
files:
- README.md
- CHANGELOG.md
- LICENSE

source:
enabled: true
format: 'tar.gz'

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: '{{ .Tag }}-next'
version_template: '{{ .Tag }}-next'

changelog:
sort: asc
Expand All @@ -35,5 +50,37 @@ changelog:

dockers:
- image_templates:
- scylladb/gemini:{{ .Version }}
- scylladb/gemini:latest
- scylladb/gemini:{{ .Version }}-amd64
goarch: amd64
goamd64: v3
goos: linux
id: gemini-amd64
build_flag_templates:
- '--platform=linux/amd64'

- image_templates:
- scylladb/gemini:{{ .Version }}-arm64v8
goarch: arm64
id: gemini-arm
goos: linux
build_flag_templates:
- '--platform=linux/arm64/v8'

docker_manifests:
- name_template: 'scylladb/gemini:{{ .Version }}'
skip_push: false
image_templates:
- 'scylladb/gemini:{{ .Version }}-amd64'
- 'scylladb/gemini:{{ .Version }}-arm64v8'

- name_template: 'scylladb/gemini:latest'
skip_push: false
image_templates:
- 'scylladb/gemini:{{ .Version }}-amd64'
- 'scylladb/gemini:{{ .Version }}-arm64v8'

release:
mode: keep-existing
make_latest: true
prerelease: auto
skip_upload: false
2 changes: 1 addition & 1 deletion cmd/gemini/Version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.8.7
v1.8.8
Loading