-
-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (132 loc) · 4.36 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
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
name: Build
on:
push:
branches:
- main
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Visual Studio shell
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.8.1'
add-tools-to-path: true
cache: true
modules: 'qtmultimedia'
- name: Install jom
id: jom-setup
shell: pwsh
run: |
$url = "https://download.qt.io/official_releases/jom/jom_1_1_4.zip"
$outputPath = "jom_1_1_4.zip"
Invoke-WebRequest -Uri $url -OutFile $outputPath
$extractPath = "jom"
if (-not (Test-Path $extractPath)) {
New-Item -ItemType Directory -Path $extractPath | Out-Null
}
Expand-Archive -Path $outputPath -DestinationPath $extractPath
$jomDir = "$(pwd)\jom"
$jomExe = "$jomDir\jom.exe"
if (Test-Path $jomExe) {
Write-Output "JOM Path: $jomDir"
Write-Output "::set-output name=jom_path::$jomDir"
} else {
Write-Error "jom.exe not found in $jomDir"
exit 1
}
- name: Build with qmake and jom
shell: pwsh
run: |
mkdir build
cd build
qmake ..\Retr0Mine.pro CONFIG+=release
$jomPath = "${{ steps.jom-setup.outputs.jom_path }}"
& "$jomPath\jom.exe"
- 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, *.qm -Recurse | Remove-Item -Force
} else {
Write-Host "Directory not found: $buildDir"
}
- name: Deploy Qt
shell: pwsh
run: |
cd build
$windeployqtPath = "D:\a\Retr0Mine\Qt\6.8.1\msvc2022_64\bin\windeployqt6.exe"
$qmlDir = "D:\a\Retr0Mine\Retr0Mine\Resources\qml"
if (Test-Path $windeployqtPath) {
& $windeployqtPath `
--skip-plugin-types designer,iconengines,qmllint,generic,networkinformation,help,imageformats,qmltooling,sqldrivers,tls,qmlls `
--no-opengl-sw `
--no-system-dxc-compiler `
--no-compiler-runtime `
--no-translations `
--no-system-d3d-compiler `
--qmldir $qmlDir `
D:\a\Retr0Mine\Retr0Mine\build\release\Retr0Mine.exe
} else {
Write-Error "windeployqt not found at the expected path!"
exit 1
}
- name: Rename release folder
shell: pwsh
run: |
$releaseDir = "build/release"
$newDir = "Retr0Mine"
if (Test-Path $releaseDir) {
Rename-Item -Path $releaseDir -NewName $newDir
} else {
Write-Error "Release folder not found!"
exit 1
}
- name: Zip binaries folder
shell: pwsh
run: |
$zipFile = "build/Retr0Mine_msvc_64.zip"
$folder = "build/Retr0Mine"
Compress-Archive -Path $folder -DestinationPath $zipFile
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Retr0Mine_msvc_64
path: build/Retr0Mine_msvc_64.zip
linux-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.6.2'
host: 'linux'
add-tools-to-path: true
modules: 'qtmultimedia'
- 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 ../Retr0Mine.pro CONFIG+=release
make -j$(nproc)
- name: Zip binaries folder
run: |
zip build/Retr0Mine_linux_64.zip build/Retr0Mine
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Retr0Mine_linux_64
path: build/Retr0Mine_linux_64.zip