forked from fabiangreffrath/woof
-
Notifications
You must be signed in to change notification settings - Fork 3
123 lines (106 loc) · 3.84 KB
/
packages.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
name: Build Packages
on:
push:
branches: [ master ]
tags: ['*']
paths-ignore: ['**.md']
pull_request:
branches: [ master ]
paths-ignore: ['**.md']
workflow_dispatch:
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: Linux GCC
os: ubuntu-22.04
toolchain: $VCPKG_INSTALLATION_ROOT
triplet: x64-linux-dynamic-release
artifact-name: Nugget-Doom-AppImage
artifact-path: build/*.appimage
extra-options: -DCMAKE_INSTALL_PREFIX=/usr
- name: MSVC x64
os: windows-latest
arch: x64
toolchain: ${env:VCPKG_INSTALLATION_ROOT}
triplet: x64-windows-static-release
artifact-name: Nugget-Doom-Win64
artifact-path: build/*.zip
extra-options: >-
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
-DCMAKE_IGNORE_PATH="C:/Strawberry/perl/bin;C:/Strawberry/c/lib"
- name: MSVC x86
os: windows-latest
arch: x86
toolchain: ${env:VCPKG_INSTALLATION_ROOT}
triplet: x86-windows-static-release
artifact-name: Nugget-Doom-Win32
artifact-path: build/*.zip
extra-options: >-
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
-DCMAKE_IGNORE_PATH="C:/Strawberry/perl/bin;C:/Strawberry/c/lib"
steps:
- uses: actions/checkout@v4
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo sed -i 's/# deb-src/deb-src/' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install ninja-build
sudo apt-get build-dep libsdl2-dev
- name: Developer Command Prompt
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.config.arch }}
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Configure
run: >-
cmake -B build -G Ninja
-DCMAKE_BUILD_TYPE=Release
-DENABLE_WERROR=ON -DENABLE_HARDENING=ON -DENABLE_LTO=ON
-DCMAKE_TOOLCHAIN_FILE="${{ matrix.config.toolchain }}/scripts/buildsystems/vcpkg.cmake"
-DVCPKG_OVERLAY_TRIPLETS="cmake/triplets"
-DVCPKG_TARGET_TRIPLET=${{ matrix.config.triplet }}
${{ matrix.config.extra-options }}
- 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 (Linux)
if: runner.os == 'Linux'
run: |
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ github.workspace }}/build/vcpkg_installed/${{ matrix.config.triplet }}/lib"
cd build
cpack
- name: Package (Windows)
if: runner.os == 'Windows'
run: |
cd build
cpack
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.artifact-name }}
path: ${{ matrix.config.artifact-path }}
- name: Extract Version Number
if: ${{ contains(github.ref, 'tags') }}
shell: bash
run: echo "VERSION=${GITHUB_REF##*_}" >> $GITHUB_ENV