-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (101 loc) · 4.02 KB
/
Copy pathbuild.yml
File metadata and controls
120 lines (101 loc) · 4.02 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
name: Build PortusSIM
# When does this run?
# - Automatically when you push a version tag like v1.0.0
# - Or manually from the Actions tab (the "workflow_dispatch" button)
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
# ============================ WINDOWS ============================
build-windows:
runs-on: windows-latest
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt pyinstaller pillow
- name: Generate icons
run: python make_icons.py
- name: Build with PyInstaller
run: pyinstaller PortusSIM.spec --noconfirm
- name: Zip the app folder
run: Compress-Archive -Path dist/PortusSIM/* -DestinationPath PortusSIM-Windows.zip
- name: Upload the Windows build
uses: actions/upload-artifact@v4
with:
name: PortusSIM-Windows
path: PortusSIM-Windows.zip
# ============================= MACOS =============================
build-macos:
runs-on: macos-latest
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt pyinstaller pillow pyobjc-framework-Cocoa
- name: Build native .icns
run: |
ICONSET="assets/logo/PortusSIM.iconset"
rm -rf "$ICONSET"; mkdir -p "$ICONSET"
cp assets/logo/portussim_mark_16.png "$ICONSET/icon_16x16.png"
cp assets/logo/portussim_mark_32.png "$ICONSET/icon_16x16@2x.png"
cp assets/logo/portussim_mark_32.png "$ICONSET/icon_32x32.png"
cp assets/logo/portussim_mark_64.png "$ICONSET/icon_32x32@2x.png"
cp assets/logo/portussim_mark_128.png "$ICONSET/icon_128x128.png"
cp assets/logo/portussim_mark_256.png "$ICONSET/icon_128x128@2x.png"
cp assets/logo/portussim_mark_256.png "$ICONSET/icon_256x256.png"
cp assets/logo/portussim_mark_512.png "$ICONSET/icon_256x256@2x.png"
cp assets/logo/portussim_mark_512.png "$ICONSET/icon_512x512.png"
iconutil -c icns "$ICONSET" -o assets/logo/PortusSIM.icns
rm -rf "$ICONSET"
- name: Build with PyInstaller
run: pyinstaller PortusSIM.spec --noconfirm
- name: Package into a .dmg
run: |
hdiutil create -volname "PortusSIM 1.0.0" \
-srcfolder "dist/PortusSIM.app" \
-ov -format UDZO "PortusSIM-macOS.dmg"
- name: Upload the macOS build
uses: actions/upload-artifact@v4
with:
name: PortusSIM-macOS
path: PortusSIM-macOS.dmg
# ===================== OPTIONAL: RELEASE ========================
# When you push a version tag, also attach both builds to a GitHub
# Release so there's a permanent, shareable download page.
release:
needs: [build-windows, build-macos]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- name: Download all build artifacts
uses: actions/download-artifact@v4
- name: Create the GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
PortusSIM-Windows/PortusSIM-Windows.zip
PortusSIM-macOS/PortusSIM-macOS.dmg
body: |
PortusSIM ${{ github.ref_name }}
**Downloads**
- Windows: `PortusSIM-Windows.zip` — unzip, run `PortusSIM.exe`
- macOS: `PortusSIM-macOS.dmg` — open, drag to Applications
Both builds are unsigned: on first launch, Windows users click
"More info -> Run anyway"; macOS users right-click the app -> Open.