forked from Taiko2k/Tauon
-
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (72 loc) · 2.36 KB
/
build_macOS.yaml
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
name: Build macOS App
on:
push:
pull_request:
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: brew update and upgrade
run: \
brew update \
brew upgrade
- name: Install brew dependencies
run: brew install gettext glib gobject-introspection gtk+3 pango sdl2 sdl2_image jpeg-xl ffmpeg@5 librsvg opusfile libopenmpt wavpack game-music-emu
- name: Install Python dependencies and setup venv
run: |
python -m pip install --upgrade pip
python -m venv .venv
source .venv/bin/activate
pip install \
-r requirements_macos.txt \
-r requirements_optional.txt \
build \
pyinstaller
- name: Build the project using python-build
run: |
source .venv/bin/activate
python -m compile_translations
python -m build --wheel
# env:
# CFLAGS: "-I/opt/homebrew/include"
# LDFLAGS: "-L/opt/homebrew/lib"
- name: Install the project into a venv
run: |
source .venv/bin/activate
pip install --prefix ".venv" dist/*.whl
# env:
# CFLAGS: "-I/opt/homebrew/include"
# LDFLAGS: "-L/opt/homebrew/lib"
- name: "[DEBUG] List all files"
run: find .
- name: Build macOS app with PyInstaller
run: |
source .venv/bin/activate
pyinstaller mac.spec
env:
DYLD_LIBRARY_PATH: "/opt/homebrew/lib"
# CFLAGS: "-I/opt/homebrew/include"
# LDFLAGS: "-L/opt/homebrew/lib"
- name: "[DEBUG] List all files in .app"
run: find "dist/TauonMusicBox.app"
- name: Create DMG
run: |
mkdir -p dist/dmg
APP_NAME="TauonMusicBox"
APP_PATH="dist/${APP_NAME}.app"
DMG_PATH="dist/dmg/${APP_NAME}.dmg"
# Create a .dmg package
hdiutil create -volname "$APP_NAME" -srcfolder "$APP_PATH" -ov -format UDZO "$DMG_PATH"
- name: Upload DMG artifact
uses: actions/upload-artifact@v4
with:
name: TauonMusicBox-dmg
path: dist/dmg/TauonMusicBox.dmg