-
Notifications
You must be signed in to change notification settings - Fork 22
321 lines (284 loc) · 9.67 KB
/
release-binaries.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
---
name: Release vega, data-node, vegawallet and visor binaries
"on":
push:
branches:
- develop
tags:
- "v*"
workflow_dispatch:
inputs:
publish:
description: 'Publish as a GitHub release'
required: false
type: boolean
default: false
tag:
description: 'Git Tag to build and publish'
required: false
type: string
default: ''
apps:
description: 'Applications to build and publish'
required: false
type: choice
options:
- [vega, data-node, vegawallet, visor]
- [vega]
- [data-node]
- [vegawallet]
- [visor]
- [vegatools]
archs:
description: 'Architecture to build and publish'
required: false
type: choice
options:
- [amd64, arm64]
- [amd64]
- [arm64]
os:
description: 'OS to build and publish'
required: false
type: choice
options:
- [linux, macos, windows]
- [linux]
- [macos]
- [windows]
disableTests:
description: 'Skip running tests'
required: false
type: boolean
default: false
jobs:
#
# Linux
#
release-linux:
if: ${{ contains(fromJson(inputs.os || '["linux"]'), 'linux') }}
name: Release ${{ matrix.app }} on Linux ${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: ${{ fromJson(inputs.archs || '["amd64", "arm64"]') }}
app: ${{ fromJson(inputs.apps || '["vega", "data-node", "vegawallet", "visor"]') }}
env:
GOOS: linux
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 0
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.21'
id: go
- name: Check out code
uses: actions/checkout@v2
with:
ref: ${{ inputs.tag }}
- name: Sanity check
run: |
git rev-parse --verify HEAD
git status
# - name: Get dependencies
# run: go get -v -t -d ./...
# - name: Run tests
# if: ${{ env.GOARCH == 'amd64' && inputs.disableTests != true }}
# run: go test -v ./...
- name: Build binary
run: go build -o build/${{ matrix.app }} ./cmd/${{ matrix.app }}
- name: Check version
if: ${{ env.GOARCH == 'amd64' }}
working-directory: build
run: ./${{ matrix.app }} version || ./${{ matrix.app }} software version
- name: Bundle binary in archive
uses: thedoctor0/zip-release@master
with:
type: zip
directory: build
filename: ${{ matrix.app }}-${{ env.GOOS }}-${{ env.GOARCH }}.zip
- name: Release
if: ${{ inputs.publish || startsWith(github.ref, 'refs/tags/') }}
uses: softprops/action-gh-release@cd28b0f5ee8571b76cfdaa62a30d51d752317477
with:
files: build/*.zip
name: ${{ inputs.tag || github.ref_name }}
tag_name: ${{ inputs.tag || github.ref_name }}
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#
# macOS
#
release-macos:
if: ${{ contains(fromJson(inputs.os || '["macos"]'), 'macos') }}
name: Release ${{ matrix.app }} on MacOS ${{ matrix.arch }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
arch: ${{ fromJson(inputs.archs || '["amd64", "arm64"]') }}
app: ${{ fromJson(inputs.apps || '["vega", "data-node", "vegawallet", "visor"]') }}
env:
GOOS: darwin
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 0
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.21'
id: go
- name: Check out code
uses: actions/checkout@v2
with:
ref: ${{ inputs.tag }}
- name: Sanity check
run: |
git rev-parse --verify HEAD
git status
# - name: Get dependencies
# run: go get -v -t -d ./...
# - name: Run tests
# if: ${{ env.GOARCH == 'amd64' && inputs.disableTests != true }}
# run: go test -v ./...
- name: Build binary
run: go build -o build/${{ matrix.app }} ./cmd/${{ matrix.app }}
- name: Import DeveloperID Certificate
# we sign vegawallet only
if: ${{ matrix.app == 'vegawallet' }}
uses: apple-actions/import-codesign-certs@v1
with:
keychain: vega
create-keychain: true
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }}
p12-password: ${{ secrets.MACOS_CERTIFICATE_PASS }}
- name: Sign binary
# we sign vegawallet only
if: ${{ matrix.app == 'vegawallet' }}
working-directory: build
# --timestamp
# During signing, requests that a timestamp authority server be contacted to authenticate the time of
# signing.
# --deep
# When signing a bundle, specifies that nested code content such as helpers, frameworks, and plug-ins,
# should be recursively signed in turn.
# --options runtime
# On macOS versions >= 10.14.0, opts signed processes into a hardened runtime environment which includes
# runtime code signing enforcement, library validation, hard, kill, and debugging restrictions.
run: codesign --verbose --sign "${{ secrets.MACOS_CERTIFICATE_IDENTITY_ID }}" --timestamp --options runtime --deep --force ${{ matrix.app }}
- name: Verify signature
# we sign vegawallet only
if: ${{ matrix.app == 'vegawallet' }}
working-directory: build
run: codesign --verbose --verify --strict --deep ${{ matrix.app }}
- name: Check version
if: ${{ env.GOARCH == 'amd64' }}
working-directory: build
run: ./${{ matrix.app }} version || ./${{ matrix.app }} software version
- name: Bundle binary in archive
uses: thedoctor0/zip-release@master
with:
type: zip
directory: build
filename: ${{ matrix.app }}-${{ env.GOOS }}-${{ env.GOARCH }}.zip
- name: Store notarization credentials
# we do notarization to vegawallet only
if: ${{ matrix.app == 'vegawallet' }}
run: |
xcrun notarytool store-credentials vega \
--apple-id "${{ secrets.MACOS_NOTARIZATION_APPLE_ID }}" \
--team-id "${{ secrets.MACOS_NOTARIZATION_TEAM_ID }}" \
--password "${{ secrets.MACOS_NOTARIZATION_PASS }}"
- name: Notarize app
# we do notarization to vegawallet only
if: ${{ matrix.app == 'vegawallet' }}
working-directory: build
run: |
xcrun notarytool submit ${{ matrix.app }}-${{ env.GOOS }}-${{ env.GOARCH }}.zip \
--keychain-profile vega \
--output-format json \
--timeout "90m" \
--wait
- name: Release
if: ${{ inputs.publish || startsWith(github.ref, 'refs/tags/') }}
uses: softprops/action-gh-release@cd28b0f5ee8571b76cfdaa62a30d51d752317477
with:
files: build/*.zip
name: ${{ inputs.tag || github.ref_name }}
tag_name: ${{ inputs.tag || github.ref_name }}
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#
# Windows
#
release-windows:
if: ${{ contains(fromJson(inputs.os || '["windows"]'), 'windows') }}
name: Release ${{ matrix.app }} on Windows ${{ matrix.arch }}
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
arch: ${{ fromJson(inputs.archs || '["amd64", "arm64"]') }}
app: ${{ fromJson(inputs.apps || '["vegawallet"]') }}
exclude:
- app: vega
- app: data-node
- app: visor
- app: vegatools
env:
GOOS: windows
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 0
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.21'
id: go
- name: Check out code
uses: actions/checkout@v2
with:
ref: ${{ inputs.tag }}
- name: Sanity check
run: |
git rev-parse --verify HEAD
git status
# - name: Get dependencies
# run: go get -v -t -d ./...
# - name: Run tests
# if: ${{ env.GOARCH == 'amd64' && inputs.disableTests != true }}
# run: go test -v ./...
- name: Build binary
run: go build -o build/${{ matrix.app }}.exe ./cmd/${{ matrix.app }}
- name: "Sign binary"
if: ${{ matrix.app == 'vegawallet' }}
uses: ./.github/actions/sign-windows-binary
with:
current-working-directory: build
binary-file: ${{ matrix.app }}.exe
gcp-credentials: ${{ secrets.GCP_CREDENTIALS }}
ev-cert-pem: ${{ secrets.EV_SIGN_CERT_FULL_CHAIN_PEM }}
- name: Check version
if: ${{ env.GOARCH == 'amd64' }}
working-directory: build
run: .\${{ matrix.app }}.exe version || .\${{ matrix.app }}.exe software version
- name: Bundle binary in archive
uses: thedoctor0/zip-release@master
with:
type: zip
directory: build
filename: ${{ matrix.app }}-${{ env.GOOS }}-${{ env.GOARCH }}.zip
- name: Release
if: ${{ inputs.publish || startsWith(github.ref, 'refs/tags/') }}
uses: softprops/action-gh-release@cd28b0f5ee8571b76cfdaa62a30d51d752317477
with:
files: build/*.zip
name: ${{ inputs.tag || github.ref_name }}
tag_name: ${{ inputs.tag || github.ref_name }}
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}