-
Notifications
You must be signed in to change notification settings - Fork 1
200 lines (172 loc) · 6 KB
/
build-and-release.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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: Build and Release
on:
workflow_dispatch:
inputs:
version:
description: "Release tag(e.g., v1.2.3) without starting 'v'"
required: true
type: string
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: "6.7.2"
add-tools-to-path: true
cache: true
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Build
run: |
mkdir build
cd build
qmake ../
nmake
- name: Remove source and object files
shell: pwsh
run: |
$buildDir = "build/release"
if (Test-Path $buildDir) {
Get-ChildItem -Path $buildDir -Include *.cpp, *.h, *.obj, *.res, *.qrc, *.qm -Recurse | Remove-Item -Force
} else {
Write-Host "Directory not found: $buildDir"
}
- name: Deploy Qt
shell: pwsh
run: |
cd build
$windeployqtPath = "D:\a\HeadsetControl-GUI\Qt\6.7.2\msvc2019_64\bin\windeployqt6.exe"
if (Test-Path $windeployqtPath) {
& $windeployqtPath `
--exclude-plugins qsvgicon,qsvg,qico,qjpeg,qgif,qnetworklistmanager,qtuiotouchplugin `
--no-opengl-sw `
--no-system-dxc-compiler `
--no-compiler-runtime `
--no-translations `
--no-system-d3d-compiler `
D:\a\HeadsetControl-GUI\HeadsetControl-GUI\build\release\HeadsetControl-GUI.exe
} else {
Write-Error "windeploygui not found at the expected path!"
exit 1
}
- name: Download ZIP from other repo
shell: pwsh
run: |
Invoke-WebRequest -Uri "https://github.com/Sapd/HeadsetControl/releases/latest/download/headsetcontrol-windows.zip" -OutFile headsetcontrol-windows.zip
Expand-Archive -Path headsetcontrol-windows.zip -DestinationPath build/release/
- name: Zip binaries folder
run: |
$zipFile = "HeadsetControl-GUI_windows_64.zip"
$folder = "build/release/*"
Compress-Archive -Path $folder -DestinationPath $zipFile
shell: pwsh
- name: Upload Windows artifact
uses: actions/upload-artifact@v4
with:
name: HeadsetControl-GUI_windows_64
path: HeadsetControl-GUI_windows_64.zip
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: "6.7.2"
host: "linux"
add-tools-to-path: true
cache: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libgl1-mesa-dev
- name: Build with qmake
run: |
mkdir build
cd build
qmake ../HeadsetControl-GUI.pro CONFIG+=release
make -j$(nproc)
- name: Zip binaries folder
run: |
zip -r HeadsetControl-GUI_linux_64.zip build/HeadsetControl-GUI
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: HeadsetControl-GUI_linux_64
path: HeadsetControl-GUI_linux_64.zip
create-release:
needs: [build-linux, build-windows]
runs-on: ubuntu-latest
if: false
steps:
- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: HeadsetControl-GUI_linux_64
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: HeadsetControl-GUI_windows_64
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ inputs.version }}
release_name: Release v${{ inputs.version }}
body: |
## Contributor
@nicola02nb Mantainer
## Credits
@Sapd for [HeadsetControl](https://github.com/Sapd/HeadsetControl)
draft: false
prerelease: false
- name: Upload Linux Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./HeadsetControl-GUI_linux_64.zip
asset_name: HeadsetControl-GUI_linux_64.zip
asset_content_type: application/octet-stream
- name: Upload Windows Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./HeadsetControl-GUI_windows_64.zip
asset_name: HeadsetControl-GUI_windows_64.zip
asset_content_type: application/octet-stream
winget-release:
needs: [create-release]
runs-on: windows-latest
#if: false
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Winget-Create
run: |
winget install wingetcreate
- name: Update manifest
env:
VERSION: ${{ inputs.version }}
run: |
wingetcreate update --version $env:VERSION --urls https://github.com/LeoKlaus/HeadsetControl-GUI/releases/latest/download/HeadsetControl-GUI_windows_64.zip LeoKlaus.HeadsetControl-GUI
winget validate .\LeoKlaus.HeadsetControl-GUI.yaml
- name: Validate manifest
env:
VERSION: ${{ inputs.version }}
run: |
winget validate --manifest manifests\l\LeoKlaus\HeadsetControl-GUI\$env:VERSION\
- name: Submit manifest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ inputs.version }}
run: |
ls