Skip to content

Commit 82aa837

Browse files
committed
ci: Do not include sig files in mac archives
Mac has its own signing process and they interfere
1 parent 6261e6c commit 82aa837

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

.github/.goreleaser.yaml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,21 @@ version: 2
44

55
# https://goreleaser.com/customization/builds/go
66
builds:
7-
- env:
8-
- CGO_ENABLED=0
9-
goarch:
10-
- amd64
11-
- arm64
7+
- id: linix-windows
8+
goos: [linux, windows]
9+
goarch: [amd64, arm64]
10+
env: [CGO_ENABLED=0]
11+
# Separating the macos builds so that we can exclude them from cosign
12+
# (since the binary is manupilated by the notarization process).
13+
- id: darwin
14+
goos: [darwin]
15+
goarch: [amd64, arm64]
16+
env: [CGO_ENABLED=0]
1217

1318
# https://goreleaser.com/customization/archive
1419
archives:
1520
- id: archives
21+
ids: [linix-windows, darwin]
1622
formats: [tar.gz]
1723
# this name template makes the OS and Arch compatible with the results of `uname`.
1824
name_template: >-
@@ -24,6 +30,7 @@ archives:
2430
files:
2531
- LICENSE
2632
- CHANGELOG.md
33+
- README.md
2734
- src: "{{ .ArtifactPath }}.sig"
2835
strip_parent: true
2936
# use zip for windows archives
@@ -53,7 +60,10 @@ notarize:
5360

5461
# https://goreleaser.com/customization/binary_sign
5562
binary_signs:
56-
- id: cosign
63+
- id: cosign-binaries
64+
# Annoyingly, build_signs runs before notarize, which messes with the
65+
# macos builds, so we only sign linux and windows builds.
66+
ids: [linux-windows]
5767
signature: "${artifact}.sig"
5868
cmd: cosign
5969
stdin: "{{ .Env.COSIGN_PWD }}"
@@ -64,6 +74,18 @@ binary_signs:
6474
- ${artifact}
6575
- --yes
6676

77+
# https://goreleaser.com/customization/sign
78+
signs:
79+
- id: cosign-checksum
80+
cmd: cosign
81+
args:
82+
- sign-blob
83+
- --key=env://COSIGN_KEY
84+
- --output-signature=${signature}
85+
- ${artifact}
86+
- --yes
87+
artifacts: checksum
88+
6789
# https://goreleaser.com/customization/release
6890
release:
69-
ids: [archives]
91+
ids: [archives, cosign-checksum]

.github/workflows/assets.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
1616
go-version-file: go.mod
1717
- name: Install Cosign
1818
uses: sigstore/cosign-installer@v3
19-
with:
20-
version: v2.0.0
2119
- name: Create app token
2220
uses: actions/create-github-app-token@v2
2321
id: app-token

0 commit comments

Comments
 (0)