-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (67 loc) · 2.45 KB
/
Copy pathbuild.yml
File metadata and controls
81 lines (67 loc) · 2.45 KB
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
name: Build/Release
on: push
jobs:
build-release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install backend dependencies
id: install-backend-deps
run: |
cd backend
pip install build
pip install -U -r requirements.txt
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install frontend dependencies
id: install-frontend-deps
run: |
cd electron
npm i --yes
- name: Create backend env.py
id: create-backend-env
run: |
cd backend
touch env.py
echo "import os" >> env.py
echo 'os.environ["STORAGE_KEY"] = "${{ secrets.STORAGE_KEY }}"' >> env.py
echo 'os.environ["SUPABASE_URL"] = "${{ secrets.SUPABASE_URL }}"' >> env.py
echo 'os.environ["SUPABASE_KEY"] = "${{ secrets.SUPABASE_KEY }}"' >> env.py
- name: Build backend executable
id: build-backend
run: npm run build-backend
- name: Prepare for app notarization
if: startsWith(matrix.os, 'macos')
# Import Apple API key for app notarization on macOS
run: |
mkdir -p ~/private_keys/
echo "${{ secrets.MAC_API_KEY }}" > ~/private_keys/AuthKey_${{ secrets.MAC_API_KEY_ID }}.p8
- name: Build/release Electron app
uses: codeofandrin/action-electron-builder@master
with:
package_root: ./electron
build_script_name: prebuild
skip_sign: ${{ !(startsWith(github.ref, 'refs/tags/v')) }}
# GitHub tokens
github_token: ${{ secrets.GH_TOKEN }}
# macOS code signing certificate
mac_certs: ${{ secrets.MAC_CERTS }}
mac_certs_password: ${{ secrets.MAC_CERTS_PASSWORD }}
# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
env:
# macOS Notarization
MAC_API_KEY_ID: ${{ secrets.MAC_API_KEY_ID }}
MAC_API_KEY_ISSUER_ID: ${{ secrets.MAC_API_KEY_ISSUER_ID }}
SKIP_NOTARIZE: ${{ !(startsWith(github.ref, 'refs/tags/v')) }}