-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (94 loc) · 3.56 KB
/
launcher-macos.yml
File metadata and controls
109 lines (94 loc) · 3.56 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
name: Launcher (macOS)
# Builds the macOS .app bundle launcher and publishes a SHA256 checksum
# next to it. Runs on:
# - push to main when launcher/ changes (smoke build, uploads an
# artifact to the workflow run for download + manual verification)
# - release tag v*.*.* (attaches the ZIP + checksum to the GitHub
# release as release assets)
#
# Parallels launcher-windows.yml and launcher-linux.yml. The launcher
# source code is platform-agnostic; only the spec file's BUNDLE block
# is macOS-specific.
#
# arm64 only for initial D-02 (macos-14 runner = Apple Silicon). Intel
# Mac support would require universal2 builds or a separate macos-13
# job - deferred until users request it.
#
# Unsigned binary: first launch requires right-click -> Open to bypass
# Gatekeeper. Code signing requires an Apple Developer account and is
# out of scope for the initial D-02.
on:
push:
branches: [main]
paths:
- "launcher/**"
- ".github/workflows/launcher-macos.yml"
pull_request:
branches: [main]
paths:
- "launcher/**"
- ".github/workflows/launcher-macos.yml"
release:
types: [created]
workflow_dispatch:
permissions:
contents: write
jobs:
build:
name: Build launcher .app bundle
runs-on: macos-14 # Apple Silicon (arm64)
defaults:
run:
working-directory: launcher
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
run: pip install poetry
- name: Install launcher dependencies
run: poetry install --no-interaction --no-ansi
- name: Run launcher unit tests
run: poetry run pytest tests/ -v
- name: Regenerate placeholder icon (PNG frames via Pillow)
run: poetry run python scripts/make_icon.py
- name: Convert placeholder icon to .icns (macOS-only iconutil)
# bibliogon.ico is multi-size; make_icns.py extracts the largest
# frame, resamples to the standard .icns size set, and invokes
# iconutil. iconutil is macOS-only so this step does not run on
# Linux/Windows builds.
run: poetry run python scripts/make_icns.py
- name: Build .app bundle
run: poetry run pyinstaller bibliogon-launcher.spec --clean --noconfirm
- name: Zip .app bundle
# Notarization / distribution expect the .app inside a ZIP or DMG.
# We ship ZIP only for initial D-02 to keep the pipeline simple.
run: |
cd dist
zip -r bibliogon-launcher-macos.zip "Bibliogon Launcher.app"
- name: Compute SHA256 checksum
run: |
cd dist
hash=$(shasum -a 256 bibliogon-launcher-macos.zip | awk '{print $1}')
echo "$hash bibliogon-launcher-macos.zip" > bibliogon-launcher-macos.zip.sha256
echo "SHA256: $hash"
- name: Upload smoke artifact (push / PR / dispatch)
if: github.event_name != 'release'
uses: actions/upload-artifact@v4
with:
name: bibliogon-launcher-macos
path: |
launcher/dist/bibliogon-launcher-macos.zip
launcher/dist/bibliogon-launcher-macos.zip.sha256
if-no-files-found: error
retention-days: 14
- name: Attach to release (tag push)
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: |
launcher/dist/bibliogon-launcher-macos.zip
launcher/dist/bibliogon-launcher-macos.zip.sha256
fail_on_unmatched_files: true