diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b5e478..af3c715 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.gitignore b/.gitignore index 6a64bbb..97f5c95 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ cmd/gemini/dist/ .vscode bin/ coverage.txt +dist/ diff --git a/.goreleaser.yml b/.goreleaser.yml index 00fcaaf..bf5f6c8 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 9454a45..b4d0e76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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}"