Skip to content

Commit

Permalink
build: improve goreleaser config
Browse files Browse the repository at this point in the history
  • Loading branch information
jooola committed Oct 11, 2023
1 parent ac1896f commit 9762b57
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 39 deletions.
45 changes: 18 additions & 27 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ before:
- go mod tidy

builds:
- id: "hcloud-build"
- id: hcloud-build
main: ./cmd/hcloud/main.go
binary: hcloud
ldflags:
Expand All @@ -18,12 +18,12 @@ builds:
- amd64
- arm
- arm64
- 386
- "386"
goarm:
- 6
- 7
- "6"
- "7"

- id: "hcloud-macos-build"
- id: hcloud-build-darwin
main: ./cmd/hcloud/main.go
binary: hcloud
ldflags:
Expand All @@ -34,46 +34,37 @@ builds:
- darwin
goarch:
- amd64
hooks:
post:
- cmd: gon -log-level DEBUG gon.hcl
output: true
- id: "hcloud-macos-arm-build"
main: ./cmd/hcloud/main.go
binary: hcloud
ldflags:
- -w -X github.com/hetznercloud/cli/internal/version.Version={{.Version}}
env:
- CGO_ENABLED=0
goos:
- darwin
goarch:
- arm64
hooks:
post:
- cmd: gon -log-level DEBUG gon_arm64.hcl
- env:
- GON_SOURCE={{ .Path }}
cmd: gon -log-level=debug gon.hcl
output: true

checksum:
name_template: "checksums.txt"
name_template: checksums.txt
algorithm: sha256

signs:
- artifacts: all
signature: "${artifact}.sig"
signature: ${artifact}.sig
id: hcloud-sign
ids:
- hcloud-build
- hcloud-macos-build
- hcloud-macos-arm-build
args: ["--batch", "-u", "[email protected]", "--pinentry-mode", "loopback", "--output", "${signature}", "--detach-sign", "${artifact}"]
- hcloud-build-darwin
args:
- --batch
- [email protected]
- --pinentry-mode=loopback
- --output=${signature}
- --detach-sign=${artifact}

archives:
- id: hcloud-archive
builds:
- hcloud-build
- hcloud-macos-build
- hcloud-macos-arm-build
- hcloud-build-darwin
name_template: "{{ .Binary }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"

format_overrides:
Expand Down
2 changes: 1 addition & 1 deletion gon.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source = ["./dist/hcloud-macos-build_darwin_amd64_v1/hcloud"]
source = ["@env:GON_SOURCE"]
bundle_id = "cloud.hetzner.cli"

apple_id {
Expand Down
11 changes: 0 additions & 11 deletions gon_arm64.hcl

This file was deleted.

0 comments on commit 9762b57

Please sign in to comment.