File tree 4 files changed +87
-18
lines changed
4 files changed +87
-18
lines changed Original file line number Diff line number Diff line change 1
1
name : release
2
2
on :
3
3
push :
4
- tags :
5
- - " v*"
4
+ # tags:
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 : Import Signing Certificates
18
+ uses : Apple-Actions/import-codesign-certs@v1
19
+ with :
20
+ p12-file-base64 : ${{ secrets.AC_CERTIFICATE_P12_BASE64 }}
21
+ p12-password : ${{ secrets.AC_CERTIFICATE_PASSWORD }}
22
+
17
23
- name : Echo Go Cache Paths
18
24
id : go-cache-paths
19
25
run : |
50
56
uses : goreleaser/goreleaser-action@v2.9.1
51
57
with :
52
58
version : latest
53
- args : release --rm-dist
59
+ args : release --rm-dist --skip-publish --skip-announce --skip-validate
54
60
env :
55
61
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
62
+ AC_USERNAME : ${{ secrets.AC_USERNAME }}
63
+ 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,43 @@ 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]
37
48
goarch : [amd64, arm64]
38
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]
57
+ goarch : [amd64, arm64]
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
+ post : |
69
+ {{- if .IsSnapshot -}}
70
+ echo "Skipping signing binary..."
71
+ {{- else -}}
72
+ codesign -s {{.Env.AC_APPLICATION_IDENTITY}} -f -v --timestamp --options runtime {{.Path}}
73
+ {{- end -}}
74
+ env :
75
+ # Apple identity for signing!
76
+ - AC_APPLICATION_IDENTITY=BDB050EB749EDD6A80C6F119BF1382ECA119CCCC
77
+
39
78
nfpms :
40
79
- id : packages
41
80
vendor : Coder
50
89
suggests :
51
90
- postgresql
52
91
builds :
53
- - coder
92
+ - coder-linux
54
93
bindir : /usr/bin
55
94
contents :
56
95
- src : coder.env
@@ -60,7 +99,13 @@ nfpms:
60
99
dst : /usr/lib/systemd/system/coder.service
61
100
62
101
release :
63
- ids : [coder, packages]
102
+ ids : [coder-linux, coder-darwin, coder-windows, packages]
103
+
104
+ signs :
105
+ - ids : [coder-darwin]
106
+ artifacts : archive
107
+ cmd : ./scripts/sign_macos.sh
108
+ args : ["${artifact}"]
64
109
65
110
snapshot :
66
111
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