-
-
Notifications
You must be signed in to change notification settings - Fork 2
325 lines (319 loc) · 10.6 KB
/
build.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
322
323
324
325
name: Desktop build
permissions:
contents: write
# Build for everything on "main" & "v*.*.*"
on:
repository_dispatch:
types: [ build ]
push:
branches:
- 'main'
- 'new-chain'
- 'v*'
tags:
- 'v*'
paths-ignore:
- '**.md'
pull_request:
branches:
- 'main'
- 'new-chain'
- 'v*'
paths-ignore:
- '**.md'
jobs:
linux:
runs-on: ubuntu-20.04
steps:
# Checkout code
- uses: actions/checkout@v4
with:
submodules: recursive
# Install GoLang
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ^1.21
- uses: actions/setup-node@v4
with:
node-version: 18.x
- uses: denoland/setup-deno@v1
with:
deno-version: v1.41.2
# Set up GoLang cache
- name: Go Cache
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# Install Wails build deps
- run: sudo apt-get update && sudo apt-get install libgtk-3-0 libwebkit2gtk-4.0-dev
- run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Build
run: |
make server-linux
wails build --platform linux/amd64 -webview2 embed
- run: chmod +x build/bin/lethean-desktop
- name: 'Tar files'
run: cd build/bin/ && tar -cvf ../../linux-lethean-desktop.tar .
# uploads the job file, makes no release
- uses: actions/upload-artifact@v4
with:
name: Linux Desktop
path: linux-lethean-desktop.tar
# if this is a tag build, upload
- name: Release Tag
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: linux-lethean-desktop.tar
- name: Release Branch
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/heads/main')
with:
tag_name: canary
prerelease: true
files: linux-lethean-desktop.tar
macos:
runs-on: macos-latest
steps:
# Checkout code
- uses: actions/checkout@v4
with:
submodules: recursive
# Install GoLang
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ^1.21
- uses: actions/setup-node@v4
with:
node-version: 18.x
- uses: denoland/setup-deno@v1
with:
deno-version: v1.41.2
# Set up GoLang cache
- name: Go Cache
uses: actions/cache@v4
with:
path: |
~/Library/Caches/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: |
go install github.com/wailsapp/wails/v2/cmd/wails@latest
brew install mitchellh/gon/gon
- name: Build
run: |
make server-macos
wails build --platform darwin/amd64 -webview2 embed
- name: chmod +x exe
run: chmod +x build/bin/lethean.app/Contents/MacOS/lethean
- name: Zip .app
working-directory: ./build/bin
run: |
ditto -c -k --keepParent ./lethean.app ../../lethean.app.zip
# - name: Import Code-Signing Certificates for macOS
# if: startsWith(github.ref, 'refs/tags/')
# uses: Apple-Actions/import-codesign-certs@v1
# with:
# keychain-password: ${{ secrets.APPLE_PASSWORD }}
# p12-file-base64: ${{ secrets.MAC_DEVELOPER_CERT }}
# p12-password: ${{ secrets.MAC_DEVELOPER_PASS }}
# - name: Import Code-Signing Certificates for macOS
# if: startsWith(github.ref, 'refs/tags/')
# uses: Apple-Actions/import-codesign-certs@v1
# with:
# keychain-password: ${{ secrets.APPLE_PASSWORD }}
# p12-file-base64: ${{ secrets.MAC_DEVELOPER_INSTALL_CERT }}
# p12-password: ${{ secrets.MAC_DEVELOPER_INSTALL_PASS }}
# create-keychain: false
# - name: Sign our macOS binary
# if: startsWith(github.ref, 'refs/tags/')
# env:
# APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
# run: |
# echo "Signing Package"
# gon -log-level=info ./build/darwin/gon-sign.json
# echo "Building Zip file"
# ditto -c -k --keepParent ./build/bin/lethean.app ./build/bin/lethean.app.zip
# echo "Building Installer"
# productbuild --sign 'Developer ID Installer: Lethean LTD (W2DNA5L5DY)' --component ./build/bin/lethean.app ./build/bin/lethean.pkg
# echo "notarising Installer and zip"
# gon -log-level=info ./build/darwin/gon-notarize.json
# uploads the job file, makes no release
- uses: actions/upload-artifact@v4
with:
name: macOS Universal Desktop
path: lethean.app.zip
# if this is a tag build, upload
- name: Release Tag
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: lethean.app.zip
- name: Release Branch
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/heads/main')
with:
tag_name: canary
prerelease: true
files: lethean.app.zip
macos-m1:
runs-on: macos-latest
steps:
# Checkout code
- uses: actions/checkout@v4
with:
submodules: recursive
# Install GoLang
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ^1.21
- uses: actions/setup-node@v4
with:
node-version: 18.x
- uses: denoland/setup-deno@v1
with:
deno-version: v1.41.2
# Set up GoLang cache
- name: Go Cache
uses: actions/cache@v4
with:
path: |
~/Library/Caches/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: |
go install github.com/wailsapp/wails/v2/cmd/wails@latest
brew install mitchellh/gon/gon
- name: Build
run: |
make server-macos-m1
wails build --platform darwin/arm64 -webview2 embed
- name: chmod +x exe
run: chmod +x build/bin/lethean.app/Contents/MacOS/lethean
- name: Zip .app
working-directory: ./build/bin
run: |
ditto -c -k --keepParent ./lethean.app ../../lethean-m1.app.zip
# - name: Import Code-Signing Certificates for macOS
# if: startsWith(github.ref, 'refs/tags/')
# uses: Apple-Actions/import-codesign-certs@v1
# with:
# keychain-password: ${{ secrets.APPLE_PASSWORD }}
# p12-file-base64: ${{ secrets.MAC_DEVELOPER_CERT }}
# p12-password: ${{ secrets.MAC_DEVELOPER_PASS }}
# - name: Import Code-Signing Certificates for macOS
# if: startsWith(github.ref, 'refs/tags/')
# uses: Apple-Actions/import-codesign-certs@v1
# with:
# keychain-password: ${{ secrets.APPLE_PASSWORD }}
# p12-file-base64: ${{ secrets.MAC_DEVELOPER_INSTALL_CERT }}
# p12-password: ${{ secrets.MAC_DEVELOPER_INSTALL_PASS }}
# create-keychain: false
# - name: Sign our macOS binary
# if: startsWith(github.ref, 'refs/tags/')
# env:
# APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
# run: |
# echo "Signing Package"
# gon -log-level=info ./build/darwin/gon-sign.json
# echo "Building Zip file"
# ditto -c -k --keepParent ./build/bin/lethean.app ./build/bin/lethean.app.zip
# echo "Building Installer"
# productbuild --sign 'Developer ID Installer: Lethean LTD (W2DNA5L5DY)' --component ./build/bin/lethean.app ./build/bin/lethean.pkg
# echo "notarising Installer and zip"
# gon -log-level=info ./build/darwin/gon-notarize.json
# uploads the job file, makes no release
- uses: actions/upload-artifact@v4
with:
name: macOS Universal Desktop
path: lethean-m1.app.zip
# if this is a tag build, upload
- name: Release Tag
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: lethean-m1.app.zip
- name: Release Branch
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/heads/main')
with:
tag_name: canary
prerelease: true
files: lethean-m1.app.zip
windows:
runs-on: windows-2022
steps:
# Checkout code
- uses: actions/checkout@v4
with:
submodules: recursive
# Install GoLang
- uses: actions/setup-go@v4
with:
go-version: ^1.21
- uses: actions/setup-node@v4
with:
node-version: 18.x
- uses: denoland/setup-deno@v1
with:
deno-version: v1.41.2
# Set up GoLang cache
- name: Go Cache
uses: actions/cache@v4
with:
path: |
%LocalAppData%\go-build
~\go\pkg\mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Eat the Choco
run: |
choco install zip -y
- run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Build
run: |
make server-windows
wails build --platform windows/amd64 -webview2 embed
- name: package
working-directory: ${{ github.workspace }}/build/bin
run: |
zip -r ${{ github.workspace }}/lethean-desktop-windows-amd64.zip *
# uploads the job file, makes no release
- uses: actions/upload-artifact@v4
with:
name: Windows Desktop
if-no-files-found: error
path: |
${{ github.workspace }}/lethean-desktop-windows-amd64.zip
# if this is a tag build, upload
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
lethean-desktop-windows-amd64.zip
- name: Release Tag
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: lethean-desktop-windows-amd64.zip
- name: Release Branch
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/heads/main')
with:
tag_name: canary
prerelease: true
files: lethean-desktop-windows-amd64.zip