-
Notifications
You must be signed in to change notification settings - Fork 7
144 lines (119 loc) · 4.95 KB
/
electron-builder.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
name: Build/release
on:
workflow_dispatch:
inputs:
run_new_release:
description: 'Run a new release'
required: false
push:
tags:
- 'v*'
jobs:
release:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
env:
is_tag: ${{ startsWith(github.ref, 'refs/tags/v') || github.event.inputs.run_new_release == 'true' }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
USE_HARD_LINKS: false #This is a workaround for a bug in electron-builder https://github.com/electron-userland/electron-builder/issues/3179
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- run: git config --global core.autocrlf false
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
# # This global ffmpeg is used for screenshots (see below)
# - uses: FedericoCarboni/setup-ffmpeg@v3
# with:
# ffmpeg-version: release
# # arm not yet supported on macos
# architecture: ${{ matrix.os == 'macos-latest' && 'x64' || '' }}
# # Linking type of the binaries. Use "shared" to download shared binaries and
# # "static" for statically linked ones. Shared builds are currently only available
# # for windows releases. Defaults to "static"
# linking-type: static
# # As of version 3 of this action, builds are no longer downloaded from GitHub
# # except on Windows: https://github.com/GyanD/codexffmpeg/releases.
# github-token: ${{ github.server_url == 'https://github.com' && github.token || '' }}
# - run: ffmpeg -version
- run: yarn install --immutable --network-timeout 1000000
# Build React app before Electron
- name: Build React app
run: yarn build-react
# Clear Electron Builder cache
- name: Clear electron-builder cache
if: startsWith(matrix.os, 'ubuntu')
run: rm -rf ~/.cache/electron-builder
# Only for Linux: Install snapcraft
- name: Install snapcraft (Linux only)
if: startsWith(matrix.os, 'ubuntu')
run: sudo snap install snapcraft --classic
- name: (MacOS) Save provisioning profile
if: startsWith(matrix.os, 'macos')
env:
PROVISIONING_PROFILE_BASE64: ${{ secrets.PROVISIONING_PROFILE_BASE64 }}
run: |
echo -n "$PROVISIONING_PROFILE_BASE64" | base64 --decode > splitBySilence_macAppStore.provisionprofile
- name: (MacOS) Prepare for app notarization
if: startsWith(matrix.os, 'macos')
run: |
mkdir -p ~/private_keys/
echo '${{ secrets.APPLE_API_KEY }}' > ~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8
- name: (MacOS) Download ffmpeg
if: startsWith(matrix.os, 'macos')
run: |
npm run download-ffmpeg-darwin-x64
npm run download-ffmpeg-darwin-arm64
- name: (Windows) Download ffmpeg
if: startsWith(matrix.os, 'windows')
run: npm run download-ffmpeg-win32-x64
- name: (Linux) Download ffmpeg
if: startsWith(matrix.os, 'ubuntu')
run: npm run download-ffmpeg-linux-x64
- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
with:
github_token: ${{ secrets.github_token }}
release: ${{ env.is_tag == 'true' }}
draft: true
max_attempts: 1
mac_certs: ${{ secrets.MAC_CERTS }}
mac_certs_password: ${{ secrets.MAC_CERTS_PASSWORD }}
env:
API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
API_KEY_ISSUER_ID: ${{ secrets.APPLE_API_ISSUER }}
- name: Print contents of dist directory
run: ls -R dist/
- name: (MacOS) Capture .pkg filename
if: startsWith(matrix.os, 'macos') && env.is_tag == 'true'
id: capture-pkg
run: |
PKG_FILE=$(ls dist/mas-universal/*.pkg)
echo "PKG_FILE=$PKG_FILE" >> $GITHUB_ENV
- name: (MacOS) Upload to Mac App Store
if: startsWith(matrix.os, 'macos') && env.is_tag == 'true'
run: |
npx tsx script/xcrun-wrapper.mts $PKG_FILE ${{ secrets.APPLE_API_KEY_ID }} ${{ secrets.APPLE_API_ISSUER }} 1552674375 com.martinbarker.digifyunique
- name: (MacOS) Upload artifacts
uses: actions/upload-artifact@v3
if: startsWith(matrix.os, 'macos') && env.is_tag == 'false'
with:
name: MacOS
path: |
dist/myCoolElectronApp-mac-arm64.dmg
dist/myCoolElectronApp-mac-x64.dmg
screenshot.jpeg
- name: (Windows) Upload artifacts
uses: actions/upload-artifact@v3
if: startsWith(matrix.os, 'windows') && env.is_tag == 'false'
with:
name: Windows
path: |
dist/myCoolElectronApp-win-x64.7z
screenshot.jpeg