-
Notifications
You must be signed in to change notification settings - Fork 4
74 lines (63 loc) · 2.05 KB
/
mac_build.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
name: Build Application with PyInstaller on Mac
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
name: Check out the repository code
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Print Machine Architecture
run: |
uname -m
if [ "$(uname -m)" = "x86_64" ]; then
echo "Running on Intel x86_64 architecture"
elif [ "$(uname -m)" = "arm64" ]; then
echo "Running on ARM64 architecture"
else
echo "Unknown architecture"
fi
- name: Build the executable with PyInstaller
run: |
pyinstaller --noconfirm --onedir --windowed --icon "./cmdcompass/static/icon.icns" --name "CmdCompass" \
--add-data "./cmdcompass/data/man_pages:data" \
--add-data "./cmdcompass/data/man_pages_kv.db:data" \
--add-data "./cmdcompass/static:static" \
--add-data "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/customtkinter:customtkinter" \
--collect-all "tkinterweb" \
--distpath "./dist" \
"./cmdcompass/main.py"
- name: Delay for filesystem
run: sleep 15
- name: Clean dist
run: |
rm -rf dist/cmdCompass/
- name: Create tar.gz Archive
run: |
tar -czvf dist/cmdCompass.tar.gz -C dist cmdCompass.app
- name: Create dmg Installer
run: |
mkdir /tmp/MyApp
cp -R ./dist/CmdCompass.app /tmp/MyApp/
ln -s /Applications /tmp/MyApp/Applications
hdiutil create -volname "CmdCompass" -srcfolder /tmp/MyApp -ov -format UDZO ./dist/CmdCompass.dmg
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: cmdCompass-artifacts
path: |
dist/CmdCompass.tar.gz
dist/CmdCompass.dmg