-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (66 loc) · 1.97 KB
/
build-macos.yml
File metadata and controls
78 lines (66 loc) · 1.97 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
name: Build macOS App
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
workflow_dispatch: # Allows manual triggering
jobs:
build-macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build macOS app using spec file
run: |
pyinstaller DrugCalculator-macos.spec
- name: Verify build
run: |
echo "Checking dist/ directory..."
ls -la dist/
if [ -d "dist/DrugCalculator.app" ]; then
echo "✅ App bundle created successfully"
du -sh dist/DrugCalculator.app
echo "Contents:"
ls -la dist/DrugCalculator.app/Contents/MacOS/
else
echo "❌ App bundle not found"
exit 1
fi
- name: Create DMG installer
if: github.event_name != 'pull_request' # Skip for PRs
run: |
# Install create-dmg
brew install create-dmg
# Create DMG installer
create-dmg \
--volname "Drug Calculator" \
--window-pos 200 120 \
--window-size 600 400 \
--icon-size 100 \
--app-drop-link 425 120 \
--no-internet-enable \
"DrugCalculator-v2.1.1-macOS.dmg" \
"dist/DrugCalculator.app"
- name: Upload app bundle
uses: actions/upload-artifact@v4
with:
name: DrugCalculator-macOS-app
path: dist/DrugCalculator.app
retention-days: 30
- name: Upload DMG
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: DrugCalculator-macOS-dmg
path: "*.dmg"
retention-days: 30