forked from fabiangreffrath/woof
-
Notifications
You must be signed in to change notification settings - Fork 3
96 lines (77 loc) · 2.6 KB
/
win_msvc.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
name: Continuous Integration (MSVC)
on:
push:
branches: [ master ]
tags: ['*']
paths-ignore: ['**.md']
pull_request:
branches: [ master ]
paths-ignore: ['**.md']
workflow_dispatch:
env:
VCPKG_DIR: C:\vcpkg
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite"
jobs:
build:
if: ${{ github.repository == 'MrAlaux/Nugget-Doom' }}
name: MSVC ${{ matrix.config.arch }}
runs-on: windows-latest
strategy:
matrix:
config:
- name: x64
arch: x64
- name: Win32
arch: x86
steps:
- uses: actions/checkout@v4
- name: Latest CMake and Ninja
uses: lukka/get-cmake@latest
- name: Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.config.arch }}
- name: Setup vcpkg and NuGet
shell: bash
run: |
set -euo pipefail
cd "${{ env.VCPKG_DIR }}"
NUGET=$(vcpkg fetch nuget | tail -n 1)
GH_PACKAGES_URL="https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
"$NUGET" sources add \
-source "$GH_PACKAGES_URL" \
-storepasswordincleartext \
-name "GitHub" \
-username "${{ github.repository_owner }}" \
-password "${{ secrets.GITHUB_TOKEN }}"
"$NUGET" setapikey "${{ secrets.GITHUB_TOKEN }}" \
-source "$GH_PACKAGES_URL"
- name: Configure
run: |
cmake -B build -G Ninja `
-DCMAKE_BUILD_TYPE=Release -DENABLE_WERROR=ON -DENABLE_LTO=ON `
-DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_DIR }}/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET="${{ matrix.config.arch }}-windows-static-release" `
-DVCPKG_OVERLAY_TRIPLETS="cmake/triplets" `
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
-DCMAKE_IGNORE_PATH="C:/Strawberry/perl/bin;C:/Strawberry/c/lib"
- name: Build
run: cmake --build build --config "Release"
- name: Test
if: github.event_name == 'workflow_dispatch'
run: |
cd demotest
pip install pyyaml joblib
python demotest --jobs 4 --port ../build/src/nugget-doom
- name: Package
run: |
cd build
cpack
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Win-${{ matrix.config.arch }}
path: build/*.zip
- name: Extract Version Number
shell: bash
run: echo "VERSION=${GITHUB_REF##*_}" >> $GITHUB_ENV