-
Notifications
You must be signed in to change notification settings - Fork 11
107 lines (93 loc) · 3.72 KB
/
build_windows.yml
File metadata and controls
107 lines (93 loc) · 3.72 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
name: Build - Windows
on:
workflow_dispatch:
inputs:
build_type:
description: 'Build Type'
default: "Debug"
required: false
type: string
workflow_call:
inputs:
version:
description: 'Version'
default: ''
required: false
type: string
build_type:
description: 'Build Type'
default: "Debug"
required: false
type: string
secrets:
SEED_KEY:
description: 'Key used to complicate the seed string in release builds'
required: false
env:
QT_VERSION: 6.7.1
EXTRA_CMAKE_FLAGS: ""
jobs:
build-desktop-application-windows:
name: Build Desktop Application Windows
runs-on: windows-latest
steps:
# Increase page size so that the compiler doesn't
# run out of memory
- name: Configure Pagefile
uses: al-cheb/configure-pagefile-action@v1.5
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "C:"
- name: Checkout Repository
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
fetch-tags: true
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ env.QT_VERSION }}
host: 'windows'
target: 'desktop'
arch: 'win64_mingw'
cache: true
- name: Install GCC 11.2.0
uses: egor-tensin/setup-mingw@v3
with:
version: 11.2.0
- name: Set Debug Flags
if: inputs.build_type == 'Debug'
run: echo "EXTRA_CMAKE_FLAGS=-DENABLE_DEBUG=True ${{ env.EXTRA_CMAKE_FLAGS }}" >> $env:GITHUB_ENV
- name: Set Release Flags
if: inputs.build_type == 'Release' && inputs.version != ''
run: echo "EXTRA_CMAKE_FLAGS=-DRELEASE_TAG=${{ inputs.version }} ${{ env.EXTRA_CMAKE_FLAGS }}" >> $env:GITHUB_ENV
- name: Configure CMake
working-directory: ${{ github.workspace }}
env:
SEED_KEY: ${{ secrets.SEED_KEY }}
run: cmake -G "MinGW Makefiles" -B build -DQT_GUI=True -DEMBED_DATA=True "${{ env.EXTRA_CMAKE_FLAGS }}"
- name: Build
working-directory: ${{ github.workspace }}
run: cmake --build build --config ${{ inputs.build_type }} -j
- name: Get Version
id: get-version
working-directory: ${{ github.workspace }}/build
run: |
echo "RANDO_VERSION=$(((Get-Content version.hpp | Select-String -Pattern '#define RANDOMIZER_VERSION "[0-9\.\-a-z]*"') -Replace '.*("[0-9\.\-a-z]*").*', '$1') -Replace '"', '')" >> $env:GITHUB_OUTPUT
- name: Call windeployqt
working-directory: ${{ github.workspace }}/build
shell: cmd # Setting up environment vars only works properly in cmd?
run: |
mkdir wwhd_rando_windows
cp wwhd_rando.exe wwhd_rando_windows\wwhd_rando.exe
cp ${{ github.workspace }}\..\Qt\${{ env.QT_VERSION }}\mingw_64\bin\libgcc_s_seh-1.dll wwhd_rando_windows\libgcc_s_seh-1.dll
cp ${{ github.workspace }}\..\Qt\${{ env.QT_VERSION }}\mingw_64\bin\libstdc++-6.dll wwhd_rando_windows\libstdc++-6.dll
cp ${{ github.workspace }}\..\Qt\${{ env.QT_VERSION }}\mingw_64\bin\libwinpthread-1.dll wwhd_rando_windows\libwinpthread-1.dll
${{ github.workspace }}\..\Qt\${{ env.QT_VERSION }}\mingw_64\bin\qtenv2.bat && cd ${{ github.workspace }}\build\wwhd_rando_windows && windeployqt wwhd_rando.exe --no-translations --no-system-d3d-compiler --no-opengl-sw
- name: Save Artifact
uses: actions/upload-artifact@v6
with:
path: ${{github.workspace}}/build/wwhd_rando_windows
name: wwhd_rando_${{ steps.get-version.outputs.RANDO_VERSION }}_windows