Skip to content

Commit 26e10ab

Browse files
authored
Merge pull request #2 from LexianDEV/copilot/fix-209b79bf-413c-4fa4-a260-63a3236cd3ab
Rework workflows to build for all PyInstaller-compatible platforms with proper release asset naming
2 parents 0a655ad + a07821d commit 26e10ab

4 files changed

Lines changed: 61 additions & 79 deletions

File tree

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Package Application with PyInstaller for Linux
1+
name: Build and Release for All Platforms
2+
23
on:
34
push:
45
branches:
@@ -9,7 +10,39 @@ on:
910

1011
jobs:
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"
@@ -67,8 +113,8 @@ jobs:
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 }}

.github/workflows/build_for_windows..yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Changed
1111
- Switched from auto-generated release notes to Keep A Changelog format
12+
- Unified build workflows for all PyInstaller-compatible platforms
13+
- Added support for macOS builds (Intel x86_64 and Apple Silicon ARM64)
14+
- Improved release asset naming with platform-specific identifiers
15+
16+
### Fixed
17+
- Fixed requirements.txt encoding issue (UTF-16 to UTF-8)
1218

1319
## [1.0.0] - 2024-08-22
1420

requirements.txt

-160 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)