-
Notifications
You must be signed in to change notification settings - Fork 1
136 lines (118 loc) · 4.42 KB
/
build-python.yml
File metadata and controls
136 lines (118 loc) · 4.42 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Build Python Application
on:
push:
branches: [ main, 0.4.1, develop, pyside-refactor ]
pull_request:
branches: [ main, 0.4.1 ]
workflow_dispatch:
inputs:
targets:
description: "Which platforms to build (push/PR always builds all)"
required: true
default: all
type: choice
options:
- all
- windows
- linux
jobs:
build-windows:
name: Windows (Nuitka one-file .exe)
runs-on: windows-latest
if: github.event_name != 'workflow_dispatch' || inputs.targets == 'all' || inputs.targets == 'windows'
timeout-minutes: 120
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install nuitka ordered-set zstandard
- name: Build with Nuitka (one-file)
timeout-minutes: 90
env:
PYTHONUNBUFFERED: "1"
NUITKA_ONEFILE: "1"
run: python build_nuitka.py
- name: Stage Windows artifact
shell: pwsh
run: powershell -ExecutionPolicy Bypass -File packaging/windows/package-zip.ps1
- name: Upload Windows artifact
uses: actions/upload-artifact@v4
with:
name: encodeforge-windows-${{ github.run_number }}
path: |
dist-packages/*.exe
if-no-files-found: error
retention-days: 14
- name: Build summary
shell: bash
run: |
echo "## Windows build" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "- Nuitka one-file Windows .exe (dist-packages/EncodeForge-*-windows-x64.exe): artifact encodeforge-windows-${{ github.run_number }}" >> "$GITHUB_STEP_SUMMARY"
build-linux-packages:
name: Linux (Nuitka + deb + rpm + AppImage)
runs-on: ubuntu-22.04
if: github.event_name != 'workflow_dispatch' || inputs.targets == 'all' || inputs.targets == 'linux'
timeout-minutes: 180
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install system packages
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
patchelf ccache file \
ruby ruby-dev build-essential rpm \
libfuse2 wget ca-certificates
- name: Install fpm
run: sudo gem install --no-document fpm
- name: Install appimagetool
run: |
wget -q -O /tmp/appimagetool \
"https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage"
chmod +x /tmp/appimagetool
sudo mv /tmp/appimagetool /usr/local/bin/appimagetool
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install nuitka ordered-set zstandard
- name: Build with Nuitka
timeout-minutes: 90
env:
PYTHONUNBUFFERED: "1"
run: python build_nuitka.py
- name: Build deb, rpm, and AppImage
run: |
chmod +x packaging/linux/build-deb-rpm.sh packaging/linux/build-appimage.sh packaging/linux/AppRun
./packaging/linux/build-deb-rpm.sh
./packaging/linux/build-appimage.sh
- name: Upload Linux packages
uses: actions/upload-artifact@v4
with:
name: encodeforge-linux-packages-${{ github.run_number }}
path: |
dist-packages/*.deb
dist-packages/*.rpm
dist-packages/*.AppImage
if-no-files-found: error
retention-days: 14
- name: Build summary
run: |
echo "## Linux packages" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "- deb, rpm, AppImage: artifact encodeforge-linux-packages-${{ github.run_number }}" >> "$GITHUB_STEP_SUMMARY"
echo "- Built on ubuntu-22.04 (x86_64) for broader glibc compatibility" >> "$GITHUB_STEP_SUMMARY"