From c55a956507d7f57a06643ae9a46584e106ec2125 Mon Sep 17 00:00:00 2001 From: Johan Siebens Date: Tue, 10 May 2022 13:23:06 +0200 Subject: [PATCH] build and release with goreleaser Signed-off-by: Johan Siebens --- .goreleaser.yaml | 95 ++++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 3 ++ 2 files changed, 98 insertions(+) create mode 100644 .goreleaser.yaml create mode 100644 Dockerfile diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..c67e7e3 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,95 @@ +project_name: ionscale + +nightly: + name_template: '{{ incminor .Version }}-dev' + +before: + hooks: + - go mod tidy + +builds: + - main: ./cmd/ionscale + env: [ CGO_ENABLED=0 ] + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + ignore: + - goos: windows + goarch: arm64 + ldflags: + - -s -w -X github.com/jsiebens/ionscale/internal/version.Version={{.Version}} -X github.com/jsiebens/ionscale/internal/version.Revision={{.ShortCommit}} + +dockers: + - image_templates: [ "ghcr.io/jsiebens/{{ .ProjectName }}:{{ .Version }}-amd64" ] + dockerfile: Dockerfile + use: buildx + build_flag_templates: + - --platform=linux/amd64 + - image_templates: [ "ghcr.io/jsiebens/{{ .ProjectName }}:{{ .Version }}-arm64" ] + goarch: arm64 + dockerfile: Dockerfile + use: buildx + build_flag_templates: + - --platform=linux/arm64 + +docker_manifests: + - name_template: ghcr.io/jsiebens/{{ .ProjectName }}:{{ .Version }} + image_templates: + - ghcr.io/jsiebens/{{ .ProjectName }}:{{ .Version }}-amd64 + - ghcr.io/jsiebens/{{ .ProjectName }}:{{ .Version }}-arm64 + - name_template: ghcr.io/jsiebens/{{ .ProjectName }}:{{ if .IsNightly }}dev{{ else }}latest{{ end }} + image_templates: + - ghcr.io/jsiebens/{{ .ProjectName }}:{{ .Version }}-amd64 + - ghcr.io/jsiebens/{{ .ProjectName }}:{{ .Version }}-arm64 + +signs: + - cmd: cosign + env: + - COSIGN_EXPERIMENTAL=1 + certificate: '${artifact}.pem' + args: + - sign-blob + - '--output-certificate=${certificate}' + - '--output-signature=${signature}' + - '${artifact}' + artifacts: checksum + +docker_signs: + - cmd: cosign + env: + - COSIGN_EXPERIMENTAL=1 + artifacts: all + output: true + args: + - sign + - '${artifact}' + +archives: + - format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - '^test:' + - '^chore' + - '^docs' + - Merge pull request + - Merge remote-tracking branch + - Merge branch + - go mod tidy + groups: + - title: 'New Features' + regexp: "^.*feat[(\\w)]*:+.*$" + order: 0 + - title: 'Bug fixes' + regexp: "^.*fix[(\\w)]*:+.*$" + order: 10 + - title: Other work + order: 999 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7f2766e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine:3.15.4 +COPY ionscale /usr/local/bin/ionscale +ENTRYPOINT ["ionscale"] \ No newline at end of file