-
-
Notifications
You must be signed in to change notification settings - Fork 408
142 lines (121 loc) · 4.4 KB
/
Copy pathwindows.yml
File metadata and controls
142 lines (121 loc) · 4.4 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
137
138
139
140
141
142
name: Windows Builds
on:
# Reusable from push_pull.yml
workflow_call:
inputs:
event_name:
type: string
description: The event name
default: ''
required: false
pull_request_number:
type: string
description: The corresponding PR number
default: ''
required: false
nightly:
type: boolean
description: Nightly build
default: false
required: false
publish:
type: boolean
description: Package publishing
default: false
required: false
jobs:
windows:
name: ${{ matrix.os.description }}
runs-on: ${{ matrix.os.architecture == 'arm64' && 'windows-11-arm' || 'windows-2025' }}
strategy:
fail-fast: false
matrix:
os: [
{ architecture: 'arm64', description: 'Windows 11 (arm64)' },
{ architecture: 'x64', description: 'Windows 11 (x64)' }
]
steps:
- name: ⬇ Checkout
uses: actions/checkout@v7
with:
submodules: recursive
fetch-depth: 0 # Ensures all tags are fetched
- name: 🔧 Prepare
shell: bash
run: |
tr -d '\n' < .version > temp && mv temp .version
if [[ "${{ inputs.event_name }}" == "pull_request" ]]; then
echo -n "+PR${{ inputs.pull_request_number }}" >> .version
elif [[ "${{ inputs.nightly }}" = true ]]; then
echo -n "+nightly$(date '+%Y%m%d')" >> .version
fi
- name: 💾 Download Pre-Build Dependencies
id: dependencies
uses: ./.github/actions/download-pre-built-deps
with:
os: 'windows'
architecture: ${{ matrix.os.architecture }}
build_type: ${{ inputs.event_name == 'pull_request' && 'relwithdebinfo' || 'release' }}
- name: 📥 Install Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
architecture: ${{ matrix.os.architecture }}
- name: 📥 Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v4
with:
version: ${{ env.QT_VERSION }}
target: 'desktop'
modules: 'qtserialport qtwebsockets'
cache: 'true'
cache-key-prefix: 'cache-qt-windows'
setup-python: 'false'
env:
QT_VERSION: ${{ steps.dependencies.outputs.qtVersion != '' && steps.dependencies.outputs.qtVersion || '' }}
- name: 📥 Install latest CMake and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: latestrc
ninjaVersion: latest
- name: 🛠️ Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.os.architecture }}
- name: Download/Install Inno Setup
run: |
echo "Checking pre-installation..."
set "ISCC_PATH=%programfiles(x86)%\Inno Setup 6\ISCC.exe"
if exist "%ISCC_PATH%" (
echo ::warning::Inno Setup is already installed
exit /b 0
)
echo "Downloading Inno Setup..."
set "_url_=https://jrsoftware.org/download.php/is.exe?site=1"
set "_file_=innosetup.exe"
curl -L -o "%tmp%\%_file_%" "%_url_%"
echo "Installing Inno Setup..."
"%tmp%\%_file_%" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
if not exist "%ISCC_PATH%" (
echo "::error::Inno Setup installation failed"
exit 1
)
echo "Inno Setup installed successfully!"
shell: cmd
- name: 👷 Build ${{ env.HINT }}
shell: cmd
run: |
cmake --preset windows-${{ env.BUILD_TYPE }} ${{ steps.dependencies.outputs.cmakeArgs }}
cmake --build --preset windows-${{ env.BUILD_TYPE }} --target package
env:
BUILD_TYPE: ${{ inputs.event_name == 'pull_request' && 'relwithdebinfo' || 'release' }}
HINT: ${{ steps.dependencies.outputs.cmakeArgs != '' && '(with pre-built dependencies)' || '(full build)' }}
- name: 📦 Upload
if: ${{ inputs.publish || inputs.event_name == 'pull_request' }}
uses: actions/upload-artifact@v7
with:
name: ${{ inputs.event_name == 'pull_request' && env.NAME || format('artifact-{0}', env.NAME) }}
path: |
build/Hyperion-*
!build/*.json
env:
NAME: ${{ format('windows_{0}', matrix.os.architecture) }}