Skip to content

Commit

Permalink
feature(releaser): better goreleaser with arm support and optimized A…
Browse files Browse the repository at this point in the history
…MD64

Signed-off-by: Dusan Malusev <[email protected]>
  • Loading branch information
CodeLieutenant committed Sep 30, 2024
1 parent ab3e873 commit ca0f5fe
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
with:
go-version: '1.23'

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ cmd/gemini/dist/
.vscode
bin/
coverage.txt
dist/
64 changes: 57 additions & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,84 @@ version: 2

env:
- GO111MODULE=on
- GOARM64=v8.0,lse,crypto
- CFLAGS="-O3"
- CXXFLAGS="-O3"

before:
hooks:
- go mod download

builds:
-
env:
- env:
- CGO_ENABLED=0
goos:
- linux
ldflags: -s -w
goarch:
- amd64
- arm64
main: ./cmd/gemini
goamd64:
- v3

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"
name_template: '{{ .Tag }}-next'

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- '^docs:'
- '^test:'

dockers:
- image_templates:
- scylladb/gemini:{{ .Tag }}
- 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
13 changes: 1 addition & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
FROM golang:1.23 AS builder

ENV GO111MODULE=on

WORKDIR /gemini

COPY . .

RUN apt-get update && apt-get install -y libc-dev build-essential \
&& make build

FROM busybox AS production

WORKDIR /gemini

COPY --from=builder /gemini/bin/gemini .
COPY gemini .

ENV PATH="/gemini:${PATH}"

Expand Down

0 comments on commit ca0f5fe

Please sign in to comment.