forked from widelands/widelands
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (57 loc) · 2.67 KB
/
build_windows.yaml
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
name: build - windows (mingw)
on:
workflow_call:
jobs:
windows:
strategy:
matrix:
config: [Debug, Release]
arch: [x64, x86]
include:
- arch: x64
bits: 64
archname: x86_64
- arch: x86
bits: 32
archname: i686
name: Windows ${{ matrix.config }} ${{ matrix.arch }} Build (MinGW)
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Installing dependencies
run: |
$env:Path = "C:\msys64\usr\bin;$env:Path"
pacman.exe --noconfirm -Syyuu --ignore ca-certificates
pacman.exe --noconfirm -Syyuu --ignore ca-certificates
bash.exe -c "./install-dependencies.sh msys${{ matrix.bits }} --noconfirm --disable-download-timeout"
choco install innosetup
- name: Compiler
run: |
$env:Path = "C:/msys64/mingw${{ matrix.bits }}/include;C:/msys64/mingw${{ matrix.bits }}/lib;C:/msys64/mingw${{ matrix.bits }}/bin;C:/msys64/usr/bin;$env:Path"
$env:CC = "C:/msys64/mingw${{ matrix.bits }}/bin/gcc.exe"
$env:CXX = "C:/msys64/mingw${{ matrix.bits }}/bin/g++.exe"
mkdir $env:GITHUB_WORKSPACE\build
cd $env:GITHUB_WORKSPACE\build
cmake.exe -G Ninja .. -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DOPTION_BUILD_WEBSITE_TOOLS=OFF -DOPTION_BUILD_TESTS=ON -DOPTION_ASAN=OFF -DUSE_XDG=OFF -DOPTION_BUILD_CODECHECK=OFF -DUSE_FLTO_IF_AVAILABLE=OFF -DCMAKE_JOB_POOLS="linking=1" -DCMAKE_JOB_POOL_LINK=linking -DOPTION_BUILD_WINSTATIC=ON -DOPTION_FORCE_EMBEDDED_MINIZIP=ON
if ((Select-String -Quiet REVDETECT-BROKEN VERSION)) { exit 1 }
cmake.exe --build .
strip -sv ./src/widelands.exe
- name: InnoSetup
run: |
cd $env:GITHUB_WORKSPACE
# Environment variables needed by our InnoSetup script
$env:PLATFORM = "${{ matrix.arch }}"
$env:MINGWPATH = "C:\msys64\mingw${{ matrix.bits }}\bin"
$env:CONFIGURATION = "${{ matrix.config }}"
$env:APPVEYOR_BUILD_FOLDER = $env:GITHUB_WORKSPACE
$env:APPVEYOR_BUILD_VERSION = "Widelands-${{ github.sha }}-${{ matrix.config }}-${{ matrix.arch }}"
strip.exe -sv .\build\src\widelands.exe
ISCC.exe /o$env:GITHUB_WORKSPACE /fWidelands-${{ github.sha }}-mingw-${{ matrix.config }}-${{ matrix.arch }} $env:GITHUB_WORKSPACE\utils\windows\innosetup\Widelands.iss
- name: Uploading installer
uses: actions/upload-artifact@v4
with:
name: Widelands ${{ matrix.config }} ${{ matrix.arch }} Installer (MinGW)
path: ${{ github.workspace }}\Widelands-${{ github.sha }}-mingw-${{ matrix.config }}-${{ matrix.arch }}.exe