-
Notifications
You must be signed in to change notification settings - Fork 6
154 lines (138 loc) · 5.01 KB
/
build-electron.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
name: Build & Release Electron App
on:
push:
branches:
- master
- release-candidate
- release-candidate-*
- feature-*
workflow_dispatch:
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-14, ubuntu-latest, windows-latest]
steps:
# Existing Steps
- name: Checkout
uses: nschloe/action-cached-lfs-checkout@v1
with:
submodules: true
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Restore Cached Electron Bundles
id: restore-cache
uses: actions/cache@v3
with:
path: |
~/.cache/electron
~/Library/Caches/electron
~/AppData/Local/electron/Cache
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}
- name: Yarn Install
run: yarn install
- name: Yarn Build
run: yarn build
- name: Upload Built App
uses: actions/upload-artifact@v3
with:
name: app-build-dir-${{ runner.os }}
path: packages/keepkey-desktop/build/
if-no-files-found: error
- name: Generate Checksum
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
./scripts/generate_checksum_windows.sh
else
./scripts/generate_checksum_unix.sh
fi
shell: bash
- name: Upload Checksum
uses: actions/upload-artifact@v3
with:
name: checksum-${{ runner.os }}
path: checksum.txt
if-no-files-found: error
- name: Mac - Prepare For App Notarization
if: startsWith(matrix.os, 'macos')
run: |
mkdir -p ~/private_keys/
echo '${{ secrets.api_key }}' > ~/private_keys/AuthKey_${{ secrets.api_key_id }}.p8
ls -al ~/private_keys # Debugging line to check the contents of the directory
chmod -R 755 ~/private_keys # Ensure proper permissions
- name: Linux - Build Electron App
if: startsWith(matrix.os, 'ubuntu')
run: yarn run release
env:
NODE_ENV: production
APPLE_ID: ${{ secrets.apple_id }}
APPLE_ID_PASSWORD: ${{ secrets.apple_id_password }}
APPLE_TEAM_ID: ${{ secrets.apple_team_id }}
GH_TOKEN: ${{ secrets.github_token }}
- name: Mac - Build Electron App
if: startsWith(matrix.os, 'macos')
run: |
yarn run release
# Copy the file with 'universal' in its name to a new version without 'universal'
for file in packages/keepkey-desktop/dist/*-universal.dmg; do
[ -f "$file" ] && cp "$file" "${file/-universal/}"
done
for file in packages/keepkey-desktop/dist/*-universal.dmg.blockmap; do
[ -f "$file" ] && cp "$file" "${file/-universal/}"
done
for file in packages/keepkey-desktop/dist/*-universal.zip; do
[ -f "$file" ] && cp "$file" "${file/-universal/}"
done
env:
NODE_ENV: production
GH_TOKEN: ${{ secrets.github_token }}
CSC_LINK: ${{ secrets.mac_certs }}
APPLE_API_KEY: ${{ secrets.apple_api_key }}
APPLE_API_KEY_ID: ${{ secrets.apple_api_key_id }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.apple_app_specific_password }}
APPLE_ID: ${{ secrets.apple_id }}
APPLE_ID_PASSWORD: ${{ secrets.apple_id_password }}
APPLE_TEAM_ID: ${{ secrets.apple_team_id }}
CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }}
- name: Windows - Build Electron App
if: startsWith(matrix.os, 'windows')
run: |
yarn run release
cp "packages/keepkey-desktop/dist/KeepKey-Desktop-*-*-arm64.dmg" "packages/keepkey-desktop/dist/KeepKey-Desktop-latest.dmg"
env:
NODE_ENV: production
GH_TOKEN: ${{ secrets.github_token }}
- name: Linux - Upload .AppImage
if: startsWith(matrix.os, 'ubuntu')
uses: actions/upload-artifact@v3
with:
name: linux-AppImage
path: |
packages/keepkey-desktop/dist/*.AppImage
packages/keepkey-desktop/dist/*.AppImage.blockmap
if-no-files-found: error
- name: Mac - Upload .dmg
if: startsWith(matrix.os, 'macos')
uses: actions/upload-artifact@v3
with:
name: mac-dmg
path: |
packages/keepkey-desktop/dist/*.dmg
packages/keepkey-desktop/dist/*.dmg.blockmap
packages/keepkey-desktop/dist/*.zip
packages/keepkey-desktop/dist/*.zip.blockmap
if-no-files-found: error
- name: Windows - Upload .exe
if: startsWith(matrix.os, 'windows')
uses: actions/upload-artifact@v3
with:
name: windows-nsis
path: |
packages/keepkey-desktop/dist/*.exe
packages/keepkey-desktop/dist/*.exe.blockmap
if-no-files-found: error