File tree 4 files changed +91
-15
lines changed
4 files changed +91
-15
lines changed Original file line number Diff line number Diff line change 5
5
- " v*"
6
6
jobs :
7
7
goreleaser :
8
- runs-on : ubuntu -latest
8
+ runs-on : macos -latest
9
9
steps :
10
10
- uses : actions/checkout@v3
11
11
with :
14
14
with :
15
15
go-version : " ~1.18"
16
16
17
+ - name : Install Gon
18
+ run : |
19
+ brew tap mitchellh/gon
20
+ brew install mitchellh/gon/gon
21
+
22
+ - name : Import Signing Certificates
23
+ uses : Apple-Actions/import-codesign-certs@v1
24
+ with :
25
+ p12-file-base64 : ${{ secrets.AC_CERTIFICATE_P12_BASE64 }}
26
+ p12-password : ${{ secrets.AC_CERTIFICATE_PASSWORD }}
27
+
17
28
- name : Echo Go Cache Paths
18
29
id : go-cache-paths
19
30
run : |
53
64
args : release --rm-dist
54
65
env :
55
66
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
67
+ AC_USERNAME : ${{ secrets.AC_USERNAME }}
68
+ AC_PASSWORD : ${{ secrets.AC_PASSWORD }}
Original file line number Diff line number Diff line change 1
1
archives :
2
- - id : coder
3
- builds :
4
- - coder
2
+ - id : coder-linux
3
+ builds : [coder-linux]
4
+ format : tar
5
+ files :
6
+ - src : docs/README.md
7
+ dst : README.md
8
+
9
+ - id : coder-darwin
10
+ builds : [coder-darwin]
11
+ format : zip
12
+ files :
13
+ - src : docs/README.md
14
+ dst : README.md
15
+
16
+ - id : coder-windows
17
+ builds : [coder-windows]
18
+ format : zip
5
19
files :
6
20
- src : docs/README.md
7
21
dst : README.md
8
- format_overrides :
9
- - goos : windows
10
- format : zip
11
22
12
23
before :
13
24
hooks :
@@ -27,15 +38,44 @@ builds:
27
38
post : |
28
39
cp {{.Path}} site/out/bin/coder-{{ .Os }}-{{ .Arch }}{{ trimprefix .Name "coder" }}
29
40
30
- - id : coder
41
+ - id : coder-linux
31
42
dir : cmd/coder
32
- flags : [" -tags=embed" ]
43
+ flags : [-tags=embed]
33
44
ldflags :
34
45
["-s -w -X github.com/coder/coder/cli/buildinfo.tag={{ .Version }}"]
35
46
env : [CGO_ENABLED=0]
36
- goos : [darwin, linux, windows]
47
+ goos : [linux]
48
+ goarch : [amd64, arm64]
49
+
50
+ - id : coder-windows
51
+ dir : cmd/coder
52
+ flags : [-tags=embed]
53
+ ldflags :
54
+ ["-s -w -X github.com/coder/coder/cli/buildinfo.tag={{ .Version }}"]
55
+ env : [CGO_ENABLED=0]
56
+ goos : [windows]
37
57
goarch : [amd64, arm64]
38
58
59
+ - id : coder-darwin
60
+ dir : cmd/coder
61
+ flags : [-tags=embed]
62
+ ldflags :
63
+ ["-s -w -X github.com/coder/coder/cli/buildinfo.tag={{ .Version }}"]
64
+ env : [CGO_ENABLED=0]
65
+ goos : [darwin]
66
+ goarch : [amd64, arm64]
67
+ hooks :
68
+ # This signs the binary that will be located inside the zip.
69
+ # MacOS requires the binary to be signed for notarization.
70
+ #
71
+ # If it doesn't successfully sign, the zip sign step will error.
72
+ post : |
73
+ sh -c 'codesign -s {{.Env.AC_APPLICATION_IDENTITY}} -f -v --timestamp --options runtime {{.Path}} || true'
74
+
75
+ env :
76
+ # Apple identity for signing!
77
+ - AC_APPLICATION_IDENTITY=BDB050EB749EDD6A80C6F119BF1382ECA119CCCC
78
+
39
79
nfpms :
40
80
- id : packages
41
81
vendor : Coder
50
90
suggests :
51
91
- postgresql
52
92
builds :
53
- - coder
93
+ - coder-linux
54
94
bindir : /usr/bin
55
95
contents :
56
96
- src : coder.env
@@ -60,7 +100,14 @@ nfpms:
60
100
dst : /usr/lib/systemd/system/coder.service
61
101
62
102
release :
63
- ids : [coder, packages]
103
+ ids : [coder-linux, coder-darwin, coder-windows, packages]
104
+
105
+ signs :
106
+ - ids : [coder-darwin]
107
+ artifacts : archive
108
+ cmd : ./scripts/sign_macos.sh
109
+ args : ["${artifact}"]
110
+ output : true
64
111
65
112
snapshot :
66
113
name_template : " {{ .Version }}-devel+{{ .ShortCommit }}"
Original file line number Diff line number Diff line change @@ -88,8 +88,8 @@ provisionersdk/proto: provisionersdk/proto/provisioner.proto
88
88
./provisionersdk/proto/provisioner.proto
89
89
.PHONY : provisionersdk/proto
90
90
91
- release : site/out
92
- goreleaser release --snapshot --rm-dist
91
+ release :
92
+ goreleaser release --snapshot --rm-dist --skip-sign
93
93
.PHONY : release
94
94
95
95
site/out :
@@ -102,4 +102,3 @@ site/out:
102
102
103
103
test :
104
104
gotestsum -- -v -short ./...
105
-
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+ cd " $( git rev-parse --show-toplevel) "
5
+
6
+ codesign -s $AC_APPLICATION_IDENTITY -f -v --timestamp --options runtime $1
7
+
8
+ config=" $( mktemp -d) /gon.json"
9
+ jq -r --null-input --arg path " $( pwd) /$1 " ' {
10
+ "notarize": [
11
+ {
12
+ "path": $path,
13
+ "bundle_id": "com.coder.cli"
14
+ }
15
+ ]
16
+ }' > $config
17
+ gon $config
You can’t perform that action at this time.
0 commit comments