-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
95 lines (92 loc) · 3.91 KB
/
windows-server-2022.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
name: Windows Server 2022 CI
on: [push, workflow_dispatch]
jobs:
build-x64:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
path: source
- name: Inspect environment
run: |
vswhere -latest
shell: pwsh
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'
- name: Install dependencies [vcpkg]
run: |
mkdir download
cd download
$zipfile = "openage-dep-x64-windows.zip"
Invoke-WebRequest https://github.com/SFTtech/openage-dependencies/releases/download/v0.5.1/openage-dep-x64-windows.zip -OutFile $zipfile
Expand-Archive -Path $zipfile -DestinationPath . -Force
Remove-Item $zipfile
(Get-ChildItem . -Recurse -File).FullName
shell: pwsh
- name: Install dependencies [winflexbison]
run: |
cd download
$zipfile = "winflexbison-2.5.24.zip"
Invoke-WebRequest https://github.com/lexxmark/winflexbison/releases/download/v2.5.24/win_flex_bison-2.5.24.zip -OutFile $zipfile
mkdir winflexbison
Expand-Archive -Path $zipfile -DestinationPath ./winflexbison -Force
Remove-Item $zipfile
(Get-ChildItem ./winflexbison -Recurse -File).FullName
shell: pwsh
- name: Install dependencies [Python]
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade Cython wheel numpy lz4 toml pillow pygments pyreadline3 mako
shell: pwsh
- name: Build
run: |
$TOOLCHAIN_FILE = Join-Path download openage-dep-x64-windows scripts buildsystems vcpkg.cmake | Resolve-Path
$FLEX_PATH = (Get-ChildItem ./download -Recurse -Force -Filter 'win_flex.exe')[0].FullName
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TRY_COMPILE_CONFIGURATION=Release -DCMAKE_CXX_FLAGS='/Zc:__cplusplus /permissive- /EHsc' -DCMAKE_EXE_LINKER_FLAGS='' -DCMAKE_MODULE_LINKER_FLAGS='' -DCMAKE_SHARED_LINKER_FLAGS='' -DDOWNLOAD_NYAN=YES -DCXX_OPTIMIZATION_LEVEL=auto -DCXX_SANITIZE_FATAL=False -DCXX_SANITIZE_MODE=none -DWANT_BACKTRACE=if_available -DWANT_GPERFTOOLS_PROFILER=if_available -DWANT_GPERFTOOLS_TCMALLOC=False -DWANT_INOTIFY=if_available -DWANT_NCURSES=if_available -DWANT_OPENGL=if_available -DWANT_VULKAN=if_available -DFLEX_EXECUTABLE="$FLEX_PATH" -G "Visual Studio 17 2022" -A x64 ../source
cmake --build . --config RelWithDebInfo -- -nologo -maxCpuCount
shell: pwsh
- name: Package
run: |
mkdir package
cd package
mkdir dll
cd ..
$STAGING_PATH = Resolve-Path package
$DLL_PATH = Join-Path package dll | Resolve-Path
cd build
$NYAN_DLL = (Get-ChildItem . -Recurse -Force -Filter 'nyan.dll')[0].FullName
$OPENAGE_DLL = (Get-ChildItem . -Recurse -Force -Filter 'openage.dll')[0].FullName
$NATIVE_OUTPUT = Split-Path -Path $OPENAGE_DLL -Parent
Copy-Item -Path ./openage -Destination $STAGING_PATH -Recurse
Copy-Item -Path $NYAN_DLL -Destination $DLL_PATH
Copy-Item -Path (Join-Path $NATIVE_OUTPUT *.dll) -Destination $DLL_PATH
Copy-Item -Path run.* -Destination $STAGING_PATH
shell: pwsh
- name: Test
run: |
$DLL_PATH = Join-Path package dll | Resolve-Path
cd package
python -m openage --add-dll-search-path $DLL_PATH --version
shell: pwsh
- name: Publish build artifacts
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: build-files
path: './build'
if-no-files-found: error
retention-days: 30
- name: Publish packaged artifacts
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: package-files
path: './package'
if-no-files-found: error
retention-days: 30