1- name : Package Application with PyInstaller for Linux
1+ name : Build and Release for All Platforms
2+
23on :
34 push :
45 branches :
910
1011jobs :
1112 build :
12- runs-on : ubuntu-latest
13+ strategy :
14+ matrix :
15+ include :
16+ # Linux x86_64
17+ - os : ubuntu-latest
18+ platform : linux
19+ arch : x86_64
20+ executable_name : Application
21+ asset_name : Application-linux-x86_64
22+
23+ # Windows x86_64
24+ - os : windows-latest
25+ platform : windows
26+ arch : x86_64
27+ executable_name : Application.exe
28+ asset_name : Application-windows-x86_64.exe
29+
30+ # macOS Intel x86_64
31+ - os : macos-13
32+ platform : macos
33+ arch : x86_64
34+ executable_name : Application
35+ asset_name : Application-macos-x86_64
36+
37+ # macOS Apple Silicon ARM64
38+ - os : macos-latest
39+ platform : macos
40+ arch : arm64
41+ executable_name : Application
42+ asset_name : Application-macos-arm64
43+
44+ runs-on : ${{ matrix.os }}
45+
1346 steps :
1447 - name : Checkout repository (with submodules)
1548 uses : actions/checkout@v4
@@ -19,14 +52,15 @@ jobs:
1952 - name : Set up Python
2053 uses : actions/setup-python@v4
2154 with :
22- python-version : " 3.13 "
55+ python-version : " 3.12 "
2356
2457 - name : Install dependencies
2558 run : |
2659 python -m pip install --upgrade pip
2760 pip install -r requirements.txt
2861
29- - name : Install PyInstaller dependencies (Linux)
62+ - name : Install Linux build dependencies
63+ if : matrix.platform == 'linux'
3064 run : |
3165 sudo apt-get update
3266 sudo apt-get install -y build-essential
@@ -35,15 +69,27 @@ jobs:
3569 run : |
3670 pyinstaller build.spec
3771
38- - name : Upload debug build artifact
72+ - name : Rename executable for release
73+ shell : bash
74+ run : |
75+ cd dist
76+ if [ -f "${{ matrix.executable_name }}" ]; then
77+ mv "${{ matrix.executable_name }}" "${{ matrix.asset_name }}"
78+ else
79+ echo "Warning: Expected executable ${{ matrix.executable_name }} not found"
80+ ls -la
81+ fi
82+
83+ - name : Upload build artifact
3984 uses : actions/upload-artifact@v4
4085 with :
41- name : dev-build
42- path : dist
86+ name : ${{ matrix.asset_name }}
87+ path : dist/${{ matrix.asset_name }}
4388
4489 - name : Extract changelog entry
4590 if : startsWith(github.ref, 'refs/tags/')
4691 id : changelog
92+ shell : bash
4793 run : |
4894 version=${GITHUB_REF_NAME#v}
4995 echo "Extracting changelog for version $version"
67113 if : startsWith(github.ref, 'refs/tags/')
68114 uses : softprops/action-gh-release@v1
69115 with :
70- files : dist/Application
116+ files : dist/${{ matrix.asset_name }}
71117 prerelease : ${{ startsWith(github.ref_name, 'b') }}
72118 body : ${{ steps.changelog.outputs.content }}
73119 env :
74- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
120+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments