This repository has been archived by the owner on Feb 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 278
587 lines (565 loc) · 24.5 KB
/
main.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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
name: Build
on:
push:
branches:
- '**'
release:
types: [ created ]
jobs:
# macos:
# runs-on: macos-11.0
# steps:
# - uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: '12.4'
# - uses: actions/checkout@v2
# with:
# fetch-depth: 1
# - name: Prepare ENV
# run: |
# TAG_NAME=$(./dist/get-tag-name.sh)
# version=${TAG_NAME/v/}
# timestamp=$(date '+%Y-%m-%d-%H-%M-%S')
# escaped_version=$(echo $version | sed 's/\./_/g')
# installer=TogglDesktop-$escaped_version-$timestamp.dmg
# installer_name=TogglDesktop-$escaped_version.dmg
# echo $version
# echo $installer
# echo $installer_name
# # Export env to all future steps
# echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
# echo "version=$version" >> $GITHUB_ENV
# echo "timestamp=$timestamp" >> $GITHUB_ENV
# echo "escaped_version=$escaped_version" >> $GITHUB_ENV
# echo "installer=$installer" >> $GITHUB_ENV
# echo "installer_name=$installer_name" >> $GITHUB_ENV
# - name: Setup Golang env
# if: github.event_name == 'release'
# uses: actions/setup-go@v1
# with:
# version: 1.13
# - name: Import signing key
# run: |
# # Create a new keychian and make it default
# security create-keychain -p password build.keychain
# security default-keychain -s ~/Library/Keychains/build.keychain
# # Mac Developer Certificate
# base64 -D <<< "${{ secrets.CERT_MACOS_DEVELOPER }}" > Bundle_cert_macos_developer.p12
# security import ./Bundle_cert_macos_developer.p12 -k ~/Library/Keychains/build.keychain -P ${{ secrets.CERT_MACOS_DEVELOPER_PASSWORD }} -T /usr/bin/codesign
# # Mac Development Certificate
# base64 -D <<< "${{ secrets.CERT_MACOS_DEVELOPMENT }}" > Bundle_cert_macos_development.p12
# security import ./Bundle_cert_macos_development.p12 -k ~/Library/Keychains/build.keychain -P ${{ secrets.CERT_MACOS_DEVELOPMENT_PASSWORD }} -T /usr/bin/codesign
# # Application Certificate
# base64 -D <<< "${{ secrets.CERT_MACOS_APPLICATION }}" > Bundle_cert_macos_distribution.p12
# security import ./Bundle_cert_macos_distribution.p12 -k ~/Library/Keychains/build.keychain -P ${{ secrets.CERT_MACOS_APPLICATION_PASSWORD }} -T /usr/bin/codesign
# # Installer Certificate
# base64 -D <<< "${{ secrets.CERT_MACOS_INSTALLER }}" > Bundle_cert_macos_installer.p12
# security import ./Bundle_cert_macos_installer.p12 -k ~/Library/Keychains/build.keychain -P ${{ secrets.CERT_MACOS_INSTALLER_PASSWORD }} -T /usr/bin/codesign
# # Unlock
# security unlock-keychain -p password ~/Library/Keychains/build.keychain
# security set-keychain-settings -lu
# security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k password ~/Library/Keychains/build.keychain
# - name: Cache cocoapods
# uses: actions/cache@v2
# with:
# path: src/ui/osx/Pods
# key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
# restore-keys: |
# ${{ runner.os }}-pods-
# - name: Get cocoapods
# run: |
# bash ./dist/osx/build.sh cocoapods
# - name: Build the application
# run: |
# bash ./dist/osx/build.sh app
# - name: Insert version string
# run: |
# bash ./dist/osx/build.sh plist
# - name: Codesign
# run: |
# bash ./dist/osx/build.sh sign
# - name: Notarize
# if: github.event_name == 'release'
# run: |
# export "APPLE_APPID_USER=${{ secrets.MACOS_APPID_USER }}"
# export "APPLE_APPID_PASSWORD=${{ secrets.MACOS_APPID_PASSWORD }}"
# bash ./dist/osx/build.sh notarize
# - name: Compose dmg
# run: |
# bash ./dist/osx/build.sh dmg
# - name: Upload artifacts to GitHub
# if: github.event_name != 'release'
# uses: actions/upload-artifact@v2
# with:
# name: TogglDesktop.dmg
# path: "${{ env.installer }}"
# - name: Update Appcast
# if: github.event_name == 'release'
# run: |
# base64 -D <<< "${{ secrets.APPCAST_PRIVATE_PEM }}" > dsa_priv.pem
# bash ./dist/osx/build.sh appcast
# - name: Upload
# if: github.event_name == 'release'
# run: |
# ./dist/upload-github-release-asset.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="$installer" renameto="$installer_name"
# - name: Update Release
# if: github.event_name == 'release'
# run: |
# bash ./dist/osx/build.sh update_release
# macos-cmake:
# runs-on: macos-11.0
# steps:
# - uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: '12.4'
# - uses: actions/checkout@v2
# with:
# fetch-depth: 1
# - name: Prepare ENV
# run: |
# TAG_NAME=$(./dist/get-tag-name.sh)
# version=${TAG_NAME/v/}
# timestamp=$(date '+%Y-%m-%d-%H-%M-%S')
# escaped_version=$(echo $version | sed 's/\./_/g')
# installer=TogglDesktop-$escaped_version-$timestamp.dmg
# installer_name=TogglDesktop-$escaped_version.dmg
# echo $version
# echo $installer
# echo $installer_name
# # Export env to all future steps
# echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
# echo "version=$version" >> $GITHUB_ENV
# echo "timestamp=$timestamp" >> $GITHUB_ENV
# echo "escaped_version=$escaped_version" >> $GITHUB_ENV
# echo "installer=$installer" >> $GITHUB_ENV
# echo "installer_name=$installer_name" >> $GITHUB_ENV
# - name: Setup Golang env
# if: github.event_name == 'release'
# uses: actions/setup-go@v1
# with:
# version: 1.13
# - name: Import signing key
# run: |
# # Create a new keychian and make it default
# security create-keychain -p password build.keychain
# security default-keychain -s ~/Library/Keychains/build.keychain
# # Mac Developer Certificate
# base64 -D <<< "${{ secrets.CERT_MACOS_DEVELOPER }}" > Bundle_cert_macos_developer.p12
# security import ./Bundle_cert_macos_developer.p12 -k ~/Library/Keychains/build.keychain -P ${{ secrets.CERT_MACOS_DEVELOPER_PASSWORD }} -T /usr/bin/codesign
# # Mac Development Certificate
# base64 -D <<< "${{ secrets.CERT_MACOS_DEVELOPMENT }}" > Bundle_cert_macos_development.p12
# security import ./Bundle_cert_macos_development.p12 -k ~/Library/Keychains/build.keychain -P ${{ secrets.CERT_MACOS_DEVELOPMENT_PASSWORD }} -T /usr/bin/codesign
# # Application Certificate
# base64 -D <<< "${{ secrets.CERT_MACOS_APPLICATION }}" > Bundle_cert_macos_distribution.p12
# security import ./Bundle_cert_macos_distribution.p12 -k ~/Library/Keychains/build.keychain -P ${{ secrets.CERT_MACOS_APPLICATION_PASSWORD }} -T /usr/bin/codesign
# # Installer Certificate
# base64 -D <<< "${{ secrets.CERT_MACOS_INSTALLER }}" > Bundle_cert_macos_installer.p12
# security import ./Bundle_cert_macos_installer.p12 -k ~/Library/Keychains/build.keychain -P ${{ secrets.CERT_MACOS_INSTALLER_PASSWORD }} -T /usr/bin/codesign
# # Unlock
# security unlock-keychain -p password ~/Library/Keychains/build.keychain
# security set-keychain-settings -lu
# security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k password ~/Library/Keychains/build.keychain
# - name: Install the dependencies
# run: |
# brew install qt
# brew install openssl
# brew install cmake
# - name: Build the application
# run: |
# mkdir build
# cd build
# export CMAKE_PREFIX_PATH=/usr/local/opt/qt5/lib/cmake
# export OPENSSL_ROOT_DIR=/usr/local/opt/[email protected]/
# cmake -DTOGGL_BUILD_TESTS=OFF -DOPENSSL_ROOT_DIR=$OPENSSL_ROOT_DIR ..
# make -j2
# linux-basic:
# runs-on: ubuntu-20.04
# if: github.event_name != 'release'
# steps:
# - uses: actions/checkout@v1
# with:
# fetch-depth: 1
# - name: Install dependencies
# run: |
# sudo apt update
# sudo apt install libxss1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 qt5-default libqt5gui5 libqt5printsupport5 libqt5quickwidgets5 libqt5x11extras5 libqt5networkauth5 libxss1
# sudo apt install patchelf binutils cmake pkg-config qtbase5-dev libqt5x11extras5-dev qtbase5-private-dev libqt5networkauth5-dev libssl-dev libxss-dev libxmu-dev
# - name: Build the Linux binary
# run: |
# export BUILD_TESTS=ON
# bash ./dist/linux/package.sh build
# - name: Run App test
# run: |
# pushd build-tarball
# ../dist/run-tests.sh test=./src/test/TogglAppTest name="App" slack_url=${{ secrets.SLACK_HOOK_URL }} slack_channel="#track-desktop-bots"
# linux-tarball:
# runs-on: ubuntu-16.04
# steps:
# - uses: actions/checkout@v1
# with:
# fetch-depth: 1
# - name: Install dependencies
# run: |
# sudo apt update
# sudo apt install libxss1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0
# sudo apt install patchelf binutils cmake pkg-config libssl-dev libxss-dev libxmu-dev
# sudo apt install dbus libfreetype6 fontconfig libx11-6 libx11-xcb1 libgl1-mesa-dev libnss3 libasound2 libxcomposite1 libxcursor1 libxi6 libxtst6 wget
# - name: Upgrade GCC
# run: |
# sudo apt-get install -y software-properties-common
# sudo add-apt-repository ppa:ubuntu-toolchain-r/test
# sudo apt update
# sudo apt install g++-7 -y
# sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7
# sudo update-alternatives --config gcc
# - name: Cache Qt
# id: cache-qt
# uses: actions/cache@v1
# with:
# path: ../Qt
# key: QtCache512-networkauth
# - name: Install Qt
# uses: jurplel/[email protected]
# with:
# cached: ${{ steps.cache-qt.outputs.cache-hit }}
# modules: qtnetworkauth
# - name: Build the Linux binary
# run: |
# export TAG_NAME=$(./dist/get-tag-name.sh)
# export CMAKE_PREFIX_PATH="$Qt5_Dir/lib/cmake/"
# bash ./dist/linux/package.sh build
# - name: Collect the binaries
# run: |
# export TAG_NAME=$(./dist/get-tag-name.sh)
# export CMAKE_PREFIX_PATH="$Qt5_Dir/lib/cmake/"
# bash ./dist/linux/package.sh compose
# - name: Create tarball
# run: |
# export TAG_NAME=$(./dist/get-tag-name.sh)
# export CMAKE_PREFIX_PATH="$Qt5_Dir/lib/cmake/"
# bash ./dist/linux/package.sh package
# - name: Upload artifacts to GitHub
# if: github.event_name != 'release'
# uses: actions/upload-artifact@v2
# with:
# name: toggldesktop_x86_64.tar.gz
# path: toggldesktop_x86_64.tar.gz
# - name: Upload to GitHub
# if: github.event_name == 'release'
# run: |
# TAG_NAME=$(./dist/get-tag-name.sh)
# ./dist/upload-github-release-asset.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="toggldesktop_x86_64.tar.gz" renameto="toggldesktop_linux_${TAG_NAME/v/}_x86_64.tar.gz"
# linux-ubuntu1604:
# runs-on: ubuntu-16.04
# steps:
# - uses: actions/checkout@v1
# with:
# fetch-depth: 1
# - name: Install signing key
# run: |
# gpg --import <<< "${{ secrets.CERT_LINUX_DEB64 }}"
# - name: Install dependencies
# run: |
# sudo apt update
# sudo apt install devscripts debhelper pkg-config libssl-dev libxss-dev libxmu-dev
# - name: Get clang 8
# run: |
# sudo apt install clang-8 libc++-8-dev libc++abi-8-dev
# - name: Upgrade CMake
# run: |
# sudo apt-key add dist/linux/kitware-archive-latest.asc
# sudo apt install apt-transport-https
# sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main'
# sudo apt update
# sudo apt -y install cmake
# - name: Cache Qt
# id: cache-qt
# uses: actions/cache@v1
# with:
# path: ../Qt
# key: QtCache512-networkauth
# - name: Install Qt
# uses: jurplel/[email protected]
# with:
# cached: ${{ steps.cache-qt.outputs.cache-hit }}
# modules: qtnetworkauth
# - name: Build a Debian package
# run: |
# export CMAKE_PREFIX_PATH="$Qt5_Dir/lib/cmake/"
# export TAG_NAME=$(./dist/get-tag-name.sh)
# export CC=/usr/bin/clang-8
# export CXX=/usr/bin/clang++-8
# cd dist/linux
# ln -s ../../src .
# ln -s ../../CMakeLists.txt .
# ln -s ../../third_party .
# ln -s ubuntu16 debian
# dch -b -D unstable --package "toggldesktop" -v ${TAG_NAME/v/} "General bug fixes and improvements" -u low -M
# debuild --preserve-envvar=CMAKE_PREFIX_PATH --preserve-envvar=CC --preserve-envvar=CXX --preserve-envvar=TAG_NAME
# - name: Upload artifacts to GitHub
# if: github.event_name != 'release'
# uses: actions/upload-artifact@v2
# with:
# name: toggldesktop_ubuntu1604_amd64.deb
# path: dist/toggldesktop_7.0.0_amd64.deb
# - name: Upload to GitHub
# if: github.event_name == 'release'
# run: |
# TAG_NAME=$(./dist/get-tag-name.sh)
# ./dist/upload-github-release-asset.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" renameto="toggldesktop_${TAG_NAME/v/}_ubuntu1604_amd64.deb" filename="dist/toggldesktop_${TAG_NAME/v/}_amd64.deb"
# linux-flatpak-kde:
# runs-on: ubuntu-18.04
# if: github.event_name == 'release'
# steps:
# - uses: actions/checkout@v1
# with:
# fetch-depth: 1
# - name: Install Flatpak
# run: |
# sudo apt update
# sudo apt install flatpak flatpak-builder
# - name: Install Flatpak KDE SDK
# run: |
# sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# sudo flatpak install --system -y flathub org.kde.Platform//5.15
# sudo flatpak install --system -y flathub org.kde.Sdk//5.15
# - name: Build Linux Flatpak package - KDE based
# run: |
# TAG_NAME=$(./dist/get-tag-name.sh)
# pushd dist/linux/flatpak
# sed -i "s/VERSION_PLACEHOLDER/${TAG_NAME/v/}/" com.toggl.TogglDesktop.json
# sudo flatpak-builder --repo=flatpak-repo --force-clean flatpak-build com.toggl.TogglDesktop.json
# flatpak build-bundle flatpak-repo com.toggl.TogglDesktop.flatpak com.toggl.TogglDesktop
# mv com.toggl.TogglDesktop.flatpak ../../..
# popd
# - name: Upload to GitHub
# run: |
# TAG_NAME=$(./dist/get-tag-name.sh)
# ./dist/upload-github-release-asset.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="com.toggl.TogglDesktop.flatpak" renameto="com.toggl.TogglDesktop-${TAG_NAME/v/}.flatpak"
# linux-dev-release:
# needs: [linux-tarball, linux-ubuntu1604]
# runs-on: ubuntu-latest
# if: github.event_name == 'release'
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 1
# - name: Add new dev channel release
# shell: bash
# run: |
# TAG_NAME=$(./dist/get-tag-name.sh)
# ./dist/update_releases.sh linux dev ${TAG_NAME/v/}
# windows-cmake:
# runs-on: windows-2019
# steps:
# - uses: actions/checkout@v1
# with:
# fetch-depth: 1
# - name: Install Qt
# uses: jurplel/install-qt-action@v2
# with:
# arch: win64_mingw73
# modules: qtnetworkauth
# - name: Install dependencies
# shell: bash
# run: |
# choco install openssl
# - name: Build the application
# shell: bash
# run: |
# mkdir build
# cd build
# export CMAKE_PREFIX_PATH="$Qt5_Dir/lib/cmake"
# export PATH="$Qt5_Dir/bin":"$PATH"
# kit=$(ls "/c/Program Files (x86)/Windows Kits/10/bin/"*"/x64/mc.exe" | head -n1 | sed s/mc.exe//)
# export PATH="$kit":"$PATH"
# export OPENSSL_ROOT_DIR="/c/Program Files/OpenSSL-Win64"
# cmake -DCMAKE_BUILD_TYPE=Release -DTOGGL_BUILD_TESTS=OFF -DOPENSSL_ROOT_DIR="${OPENSSL_ROOT_DIR}" .. -G "MinGW Makefiles"
# cmake --build .
windows-32bit:
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install signing key
run: |
echo "${{ secrets.CERT_WINDOWS_STANDALONE }}" > Certificate.b64
base64 -d Certificate.b64 > Certificate.pfx
cp Certificate.pfx dist/windows
shell: bash
- name: Set version
if: github.event_name == 'release'
shell: bash
run: |
TAG_NAME=$(./dist/get-tag-name.sh)
echo "Setting version to ${TAG_NAME/v/}"
bash dist/windows/scripts/set_version.sh "${TAG_NAME/v/}"
- name: Cache POCO bin
id: cache-poco-bin
uses: actions/cache@v1
with:
path: third_party/poco/bin
key: ${{ runner.os }}-poco-bin-1.9.0
- name: Cache POCO lib
id: cache-poco-lib
uses: actions/cache@v1
with:
path: third_party/poco/lib
key: ${{ runner.os }}-poco-lib-1.9.0
- name: Clean
shell: cmd
run: dotnet nuget locals all --clear
- name: Build on Windows x86 without POCO
if: steps.cache-poco-bin.outputs.cache-hit == 'true'
shell: cmd
run: |
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" /p:Configuration=Release /p:Platform="x86" /t:Clean,Build /restore /m src\ui\windows\TogglDesktop\TogglDesktop.NoPoco.sln
- name: Build on Windows x86
if: steps.cache-poco-bin.outputs.cache-hit != 'true'
shell: cmd
run: |
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" /p:Configuration=Release /p:Platform="x86" /t:Clean,Build /restore /m src\ui\windows\TogglDesktop\TogglDesktop.sln
- name: Sign binaries
if: github.event_name == 'release'
run: |
./dist/windows/scripts/sign.sh cert_password=${{ secrets.CERT_WINDOWS_PASSWORD }}
shell: bash
- name: Create x86 installer
run: |
cd dist/windows
makensis /DCERT_PASSWORD=${{ secrets.CERT_WINDOWS_PASSWORD }} TogglDesktopInstaller-x86.nsi
- name: Sign the installer
if: github.event_name == 'release'
shell: cmd
run: |
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64\signtool.exe" sign -fd SHA256 -a -t http://timestamp.digicert.com -f Certificate.pfx -p "${{ secrets.CERT_WINDOWS_PASSWORD }}" dist\windows\TogglDesktopInstaller.exe
- name: Upload artifacts to GitHub
if: github.event_name != 'release'
uses: actions/upload-artifact@v2
with:
name: TogglDesktopInstaller-x86.exe
path: dist\windows\TogglDesktopInstaller.exe
- name: Upload to GitHub
if: github.event_name == 'release'
run: |
TAG_NAME=$(./dist/get-tag-name.sh)
./dist/upload-github-release-asset.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="dist/windows/TogglDesktopInstaller.exe" renameto="TogglDesktopInstaller-${TAG_NAME/v/}.exe"
shell: bash
windows-64bit:
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install signing key
run: |
echo "${{ secrets.CERT_WINDOWS_STANDALONE }}" > Certificate.b64
base64 -d Certificate.b64 > Certificate.pfx
cp Certificate.pfx dist/windows
shell: bash
- name: Set version
if: github.event_name == 'release'
shell: bash
run: |
TAG_NAME=$(./dist/get-tag-name.sh)
echo "Setting version to ${TAG_NAME/v/}"
bash dist/windows/scripts/set_version.sh "${TAG_NAME/v/}"
- name: Cache POCO bin64
id: cache-poco-bin64
uses: actions/cache@v1
with:
path: third_party/poco/bin64
key: ${{ runner.os }}-poco-bin64-1.9.0
- name: Cache POCO lib64
id: cache-poco-lib64
uses: actions/cache@v1
with:
path: third_party/poco/lib64
key: ${{ runner.os }}-poco-lib64-1.9.0
- name: Clean
shell: cmd
run: dotnet nuget locals all --clear
- name: Build on Windows x64 without POCO
if: steps.cache-poco-bin64.outputs.cache-hit == 'true'
shell: cmd
run: |
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" /p:Configuration=Release /p:Platform="x64" /t:Clean,Build /restore /m src\ui\windows\TogglDesktop\TogglDesktop.NoPoco.sln
- name: Build on Windows x64
if: steps.cache-poco-bin64.outputs.cache-hit != 'true'
shell: cmd
run: |
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" /p:Configuration=Release /p:Platform="x64" /t:Clean,Build /restore /m src\ui\windows\TogglDesktop\TogglDesktop.sln
- name: Sign binaries
if: github.event_name == 'release'
run: |
./dist/windows/scripts/sign.sh cert_password=${{ secrets.CERT_WINDOWS_PASSWORD }}
shell: bash
- name: Make x64 installer
run: |
cd dist/windows
makensis /DCERT_PASSWORD=${{ secrets.CERT_WINDOWS_PASSWORD }} TogglDesktopInstaller-x64.nsi
- name: Sign the installer
if: github.event_name == 'release'
shell: cmd
run: |
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64\signtool.exe" sign -fd SHA256 -a -t http://timestamp.digicert.com -f Certificate.pfx -p "${{ secrets.CERT_WINDOWS_PASSWORD }}" dist\windows\TogglDesktopInstaller-x64.exe
- name: Upload artifacts to GitHub
if: github.event_name != 'release'
uses: actions/upload-artifact@v2
with:
name: TogglDesktopInstaller-x64.exe
path: dist\windows\TogglDesktopInstaller-x64.exe
- name: Upload to GitHub
if: github.event_name == 'release'
run: |
TAG_NAME=$(./dist/get-tag-name.sh)
./dist/upload-github-release-asset.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="dist/windows/TogglDesktopInstaller-x64.exe" renameto="TogglDesktopInstaller-x64-${TAG_NAME/v/}.exe"
shell: bash
windows-dev-release:
needs: [windows-32bit, windows-64bit]
runs-on: ubuntu-latest # anything supporting bash
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Add new dev channel release
shell: bash
run: |
TAG_NAME=$(./dist/get-tag-name.sh)
./dist/update_releases.sh win dev ${TAG_NAME/v/}
windows-store:
runs-on: windows-2019
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install signing key - Part 1
run: |
echo "${{ secrets.CERT_WINDOWS_STORE_V2 }}" > Certificate.b64
base64 -d Certificate.b64 > Certificate.pfx
shell: bash
- name: Install signing key - Part 2
run: |
$SecurePassword = "1" | ConvertTo-SecureString -AsPlainText -Force
Import-PfxCertificate -FilePath Certificate.pfx cert:\currentUser\My -Password $SecurePassword
shell: powershell
- name: Set version
shell: bash
run: |
TAG_NAME=$(./dist/get-tag-name.sh)
echo "Setting version to ${TAG_NAME/v/}"
bash dist/windows/scripts/set_version.sh "${TAG_NAME/v/}"
- name: Build on Windows for Microsoft Store
shell: cmd
run: |
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" /p:Configuration=StoreRelease /p:Platform="x86" /p:AppxPackageSigningEnabled=false /t:Clean,Build /restore -m src\ui\windows\TogglDesktop\TogglDesktop.sln
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" /p:Configuration=StoreRelease /p:Platform="x64" /p:UapAppxPackageBuildMode=CI /p:AppxBundle=Always /p:AppxBundlePlatforms="x86|x64" /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="2AFAD2683749B3194CB0CB1D720900DC51AB90FE" /p:AppxPackageDir="..\\..\\..\\..\\..\\" /t:Clean,Build /restore -m src\ui\windows\TogglDesktop\TogglDesktop.sln
dir
- name: Upload to GitHub
run: |
TAG_NAME=$(./dist/get-tag-name.sh)
./dist/upload-github-release-asset.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="TogglDesktop.Package_${TAG_NAME/v/}.0_x86_x64_bundle_StoreRelease.appxupload"
shell: bash