-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (71 loc) · 2.42 KB
/
Copy pathrelease.yml
File metadata and controls
84 lines (71 loc) · 2.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
name: Release Build
on:
release:
types: [published]
permissions:
contents: write
jobs:
build-windows:
name: Nuitka Build (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PyQt5 PyQt-Fluent-Widgets pyserial pyqtgraph nuitka ordered-set
- name: Extract version from tag
id: version
shell: bash
run: |
TAG="${GITHUB_REF#refs/tags/}"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
VER="${TAG#v}"
echo "ver=$VER" >> "$GITHUB_OUTPUT"
- name: Build with Nuitka
shell: cmd
run: |
set CL=/utf-8
python -m nuitka ^
--standalone ^
--assume-yes-for-downloads ^
--mingw64 ^
--enable-plugins=pyqt5 ^
--windows-console-mode=disable ^
--windows-icon-from-ico=logo.ico ^
--windows-product-name="PyQt UI Designer" ^
--windows-product-version=${{ steps.version.outputs.ver }}.0 ^
--windows-file-version=${{ steps.version.outputs.ver }}.0 ^
--windows-file-description="PyQt UI Designer - HMI Application Builder" ^
--windows-company-name="PyQt-UI-Designer" ^
--show-progress ^
--output-dir=build ^
main.py
- name: Prepare distribution
shell: pwsh
run: |
$distName = "PyQt-UI-Designer-${{ steps.version.outputs.tag }}"
$distSrc = "build\main.dist"
if (Test-Path $distSrc) {
Rename-Item $distSrc $distName
$distPath = "build\$distName"
} else {
Write-Error "Nuitka output not found at $distSrc"
exit 1
}
# Copy logo if exists
if (Test-Path "logo.ico") {
Copy-Item "logo.ico" "$distPath\logo.ico"
}
# Create zip
Compress-Archive -Path $distPath -DestinationPath "build\$distName.zip" -Force
echo "ASSET_PATH=build\$distName.zip" >> $env:GITHUB_ENV
echo "ASSET_NAME=$distName.zip" >> $env:GITHUB_ENV
- name: Upload to Release
uses: softprops/action-gh-release@v2
with:
files: ${{ env.ASSET_PATH }}