-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (112 loc) · 4.51 KB
/
build.yml
File metadata and controls
129 lines (112 loc) · 4.51 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
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
name: Build/Release
on:
# only on tags which follow semantic versioning
push:
tags:
- "v*"
jobs:
build-release:
runs-on: macos-latest
strategy:
matrix:
arch: [x64, arm64]
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Set Up Python arm64
if: matrix.arch == 'arm64'
id: setup-python-arm64
run: |
curl -O -L https://www.python.org/ftp/python/3.9.13/python-3.9.13-macos11.pkg
sudo installer -pkg python-3.9.13-macos11.pkg -target /
cd ..
- name: Set Up Python x64
if: matrix.arch == 'x64'
id: setup-python-x64
run: |
curl -O -L https://www.python.org/ftp/python/3.9.13/python-3.9.13-macosx10.9.pkg
sudo installer -pkg python-3.9.13-macosx10.9.pkg -target /
cd ..
- name: Install backend dependencies
id: install-backend-deps
run: |
cd backend
python3.9 -m pip install --upgrade pip
python3.9 -m pip install build
python3.9 -m 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
# NOTE:
# Since July 03, 2025 exifoo is free to use and open source.
# Therefore, there is no need anymore for the Supabase database
run: |
cd backend
touch env.py
echo "import os" >> env.py
echo 'os.environ["STORAGE_KEY"] = "${{ secrets.STORAGE_KEY }}"' >> env.py
echo 'os.environ["SENTRY_DSN"] = "https://0c8ff8b575885439f0ea71f2353ddb31@o4508083247382528.ingest.de.sentry.io/4508632426217552"' >> env.py
# 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
# echo 'os.environ["SENTRY_DSN"] = "https://0c8ff8b575885439f0ea71f2353ddb31@o4508083247382528.ingest.de.sentry.io/4508632426217552"' >> env.py
- name: Build backend executable arm64
id: build-backend-arm64
if: matrix.arch == 'arm64'
run: |
cd backend
pyinstaller build_mac_arm64.spec
- name: Build backend executable x64
id: build-backend-x64
if: matrix.arch == 'x64'
run: |
cd backend
pyinstaller build_mac_x64.spec
- name: Prepare for app notarization
# 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
args: ${{ matrix.arch == 'x64' && '--x64' || '--arm64' }}
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')) }}
SENTRY_DSN: https://28906d568b4e2ece1282720a92ae48d1@o4508083247382528.ingest.de.sentry.io/4508632446795856
- name: Install sentry-cli
run: curl -sL https://sentry.io/get-cli/ | sh
- name: Create Sentry release
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: puncher1
run: |
VERSION=$(sentry-cli releases propose-version)
sentry-cli releases new -p exifoo-electron $VERSION
sentry-cli releases set-commits --auto $VERSION