-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (59 loc) · 2.4 KB
/
build.yml
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
name: Build Executable for Multiple Platforms
on: [push]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
# Set up Python for Ubuntu, macOS, and Windows
- name: Set up Python (Ubuntu/macOS/Windows)
uses: actions/setup-python@v2
with:
python-version: '3.x'
# Install dependencies and PyInstaller for Ubuntu, macOS, and Windows using requirements.txt
- name: Install dependencies (Ubuntu/macOS/Windows)
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# Build with PyInstaller for Ubuntu, macOS, and Windows
- name: Build with PyInstaller (Ubuntu/macOS/Windows)
run: |
pyinstaller --onefile --windowed SortingApp.py
# macOS-specific step to set executable permissions and zip the .app bundle
- name: Set permissions and zip .app for macOS
if: matrix.os == 'macos-latest'
run: |
chmod +x dist/SortingApp.app/Contents/MacOS/SortingApp
cd dist
zip -r SortingApp-macOS.zip SortingApp.app
# Upload the native Ubuntu/macOS/Windows builds
- name: Upload executable (Native Builds)
uses: actions/upload-artifact@v3
with:
name: executable-${{ matrix.os }}
path: |
dist/*.zip
dist/*.exe
dist/*.AppImage
# Additional step: Build for Red Hat-compatible (via Docker) on Ubuntu
- name: Build for Red Hat-compatible (via Docker)
if: matrix.os == 'ubuntu-latest'
run: |
docker run --rm -v ${{ github.workspace }}:/src -w /src almalinux:8 \
bash -c "yum install -y epel-release && \
yum install -y mesa-libGL-devel python3 python3-devel gcc zlib-devel qt5-qtbase-devel qt5-qtbase-gui qt5-qtwebsockets qt5-qtsvg && \
python3 -m pip install wheel && \
python3 -m pip install --upgrade pip setuptools && \
python3 -m pip install --user --no-binary :all: PyQt6 && \
python3 -m pip install -r requirements.txt && \
pyinstaller --onefile --windowed SortingApp.py"
# Upload the Red Hat-compatible build
- name: Upload Red Hat-compatible executable
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: executable-redhat
path: dist/*