-
Notifications
You must be signed in to change notification settings - Fork 0
331 lines (284 loc) · 13.9 KB
/
release.yaml
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
322
323
324
325
326
327
328
329
330
331
name: release
on:
push:
tags:
- "*"
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: goversion
run: echo "goversion=$(make goversion)" >> "$GITHUB_OUTPUT"
id: goversion
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ steps.goversion.outputs.goversion }}
- name: build artifacts
run: make buildall
- name: Upload binary artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/
sign_darwin:
needs: build
name: Sign Darwin
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Version
run: echo "version=$(make bridgeversion)" >> "$GITHUB_OUTPUT"
id: version
- name: Prerelease
run: echo "prerelease=$(make ispre)" >> "$GITHUB_OUTPUT"
id: prerelease
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: dist
path: dist/
- name: Import Certificates
uses: Apple-Actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.DEVELOPER_ID_CERT }}
p12-password: ${{ secrets.DEVELOPER_ID_CERT_PASSWORD }}
- name: Sign darwin amd64 binary
run: codesign -s EF141CA55650788DF2FFE58E51071F048243BFE6 -o runtime --timestamp -f -v ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-darwin-amd64
- name: Sign darwin arm64 binary
run: codesign -s EF141CA55650788DF2FFE58E51071F048243BFE6 -o runtime --timestamp -f -v ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-darwin-arm64
- name: Compress darwin amd64 binary
run: chmod a+x dist/v${{ steps.version.outputs.version }}/nebulant-bridge-darwin-amd64 && zip -jrm ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-darwin-amd64.zip ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-darwin-amd64
- name: Compress darwin arm64 binary
run: chmod a+x dist/v${{ steps.version.outputs.version }}/nebulant-bridge-darwin-arm64 && zip -jrm ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-darwin-arm64.zip ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-darwin-arm64
- name: Notarize darwin amd64 binary
run: xcrun notarytool submit ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-darwin-amd64.zip --apple-id ${{ secrets.APPLE_ID_APPLICATION_USERNAME }} --team-id ${{ secrets.APPLE_TEAM_ID }} --password ${{ secrets.APPLE_ID_APPLICATION_PASSWORD }} --verbose --wait
- name: Notarize darwin arm64 binary
run: xcrun notarytool submit ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-darwin-arm64.zip --apple-id ${{ secrets.APPLE_ID_APPLICATION_USERNAME }} --team-id ${{ secrets.APPLE_TEAM_ID }} --password ${{ secrets.APPLE_ID_APPLICATION_PASSWORD }} --verbose --wait
- name: Upload binary artifacts (darwin signed)
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/
release:
needs: sign_darwin
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: dist
path: dist/
- name: Version
run: echo "version=$(make bridgeversion)" >> "$GITHUB_OUTPUT"
id: version
- name: Prerelease
run: echo "prerelease=$(make ispre)" >> "$GITHUB_OUTPUT"
id: prerelease
- name: Create release notes
run: shasum dist/*/nebulant* > SHASUM && mkdir -p tmp && cp RELEASE.md tmp/NOTES.md && echo -e "\n## SHASUM\n\`\`\`" >> tmp/NOTES.md && cat SHASUM >> tmp/NOTES.md && echo -e "\n\`\`\`" >> tmp/NOTES.md
- name: release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: ${{ fromJSON(steps.prerelease.outputs.prerelease) }}
release_name: nebulant-bridge ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref }}
body_path: tmp/NOTES.md
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload linux-arm artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-linux-arm
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-linux-arm
asset_content_type: application/x-executable
- name: Upload linux-arm64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-linux-arm64
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-linux-arm64
asset_content_type: application/x-executable
- name: Upload linux-386 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-linux-386
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-linux-386
asset_content_type: application/x-executable
- name: Upload linux-amd64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-linux-amd64
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-linux-amd64
asset_content_type: application/x-executable
- name: Upload freebsd-386 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-freebsd-386
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-freebsd-386
asset_content_type: application/x-executable
- name: Upload freebsd-amd64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-freebsd-amd64
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-freebsd-amd64
asset_content_type: application/x-executable
- name: Upload freebsd-arm64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-freebsd-arm64
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-freebsd-arm64
asset_content_type: application/x-executable
- name: Upload freebsd-arm artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-freebsd-arm
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-freebsd-arm
asset_content_type: application/x-executable
- name: Upload openbsd-386 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-openbsd-386
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-openbsd-386
asset_content_type: application/x-executable
- name: Upload openbsd-amd64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-openbsd-amd64
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-openbsd-amd64
asset_content_type: application/x-executable
- name: Upload openbsd-arm64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-openbsd-arm64
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-openbsd-arm64
asset_content_type: application/x-executable
- name: Upload openbsd-arm artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-openbsd-arm
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-openbsd-arm
asset_content_type: application/x-executable
- name: Upload windows-386.exe artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-windows-386.exe
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-windows-386.exe
asset_content_type: application/x-dosexec
- name: Upload windows-amd64.exe artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-windows-amd64.exe
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-windows-amd64.exe
asset_content_type: application/x-dosexec
- name: Upload windows-arm64.exe artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-windows-arm64.exe
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-windows-arm64.exe
asset_content_type: application/x-dosexec
- name: Upload windows-arm.exe artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-windows-arm.exe
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-windows-arm.exe
asset_content_type: application/x-dosexec
- name: Upload darwin-amd64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-darwin-amd64.zip
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-darwin-amd64.zip
asset_content_type: application/x-mach-binary
- name: Upload darwin-arm64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/v${{ steps.version.outputs.version }}/nebulant-bridge-darwin-arm64.zip
asset_name: nebulant-bridge-${{ steps.version.outputs.version }}-darwin-arm64.zip
asset_content_type: application/x-mach-binary
- name: Upload shasum artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./SHASUM
asset_name: SHASUM
asset_content_type: text/plain
- name: Prepare upload to r2 version number
run: echo "VERSION_NUMBER=$(make goversion)" >> "$GITHUB_OUTPUT"
id: vnumber
- name: Prepare upload to r2 version date
run: echo "VERSION_DATE=$(git log -1 --date=format:'%Y/%m/%d' --format=%cd)" >> "$GITHUB_OUTPUT"
id: vdate
- name: Download latest version of cli
run: curl "https://releases.nebulant.app/v0.5.1-beta/nebulant-linux-amd64" -o nebulant
- name: Upload to r2
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_ACCESS_KEY_ID }}
CLOUDFLARE_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }}
run: chmod a+x ./nebulant && ./nebulant run -f ./publish_release.nbp --SOURCEPATH=./dist/ --DSTPATH="bridge/" --BUCKET=nebulant-app-cli-releases --VERSION_NUMBER=${{ steps.vnumber.outputs.VERSION_NUMBER }} --VERSION_DATE=${{ steps.vdate.outputs.VERSION_DATE }} --URL_DOMAIN=releases.nebulant.app