-
Notifications
You must be signed in to change notification settings - Fork 66
89 lines (72 loc) · 2.62 KB
/
build-windows.yml
File metadata and controls
89 lines (72 loc) · 2.62 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
name: Build - Windows
on:
workflow_dispatch:
permissions:
contents: read
jobs:
build-windows:
name: Windows-Release
runs-on: windows-2022
env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}\vcpkg_cache
VCPKG_COMMIT: '734f8130ffe2f02cf855a3a42a2958f01b3fb005'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Get latest CMake and Ninja
uses: lukka/get-cmake@v3.31.6
- name: Create vcpkg cache directory
run: mkdir -p "${{ env.VCPKG_DEFAULT_BINARY_CACHE }}"
shell: bash
- name: Restore vcpkg binary cache
id: vcpkg-cache
uses: actions/cache@v4
with:
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
key: vcpkg-bin-${{ runner.os }}-${{ env.VCPKG_COMMIT }}-${{ hashFiles('vcpkg.json') }}
restore-keys: |
vcpkg-bin-${{ runner.os }}-${{ env.VCPKG_COMMIT }}-
- name: Restore vcpkg installed packages
id: vcpkg-installed
uses: actions/cache@v4
with:
path: build/vcpkg_installed
key: vcpkg-installed-${{ runner.os }}-${{ env.VCPKG_COMMIT }}-${{ hashFiles('vcpkg.json') }}
restore-keys: |
vcpkg-installed-${{ runner.os }}-${{ env.VCPKG_COMMIT }}-
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
vcpkgJsonGlob: 'vcpkg.json'
- name: Configure CMake
shell: pwsh
run: |
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 `
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
-DVCPKG_INSTALL_OPTIONS="--clean-after-build" `
-DCMAKE_BUILD_TYPE=Release
- name: Build
shell: pwsh
run: cmake --build build --config Release --parallel
- name: Prepare Artifacts
shell: pwsh
run: |
$artifactDir = "$env:GITHUB_WORKSPACE\artifacts"
New-Item -ItemType Directory -Force -Path $artifactDir | Out-Null
$exePath = Get-ChildItem -Recurse -Path "$env:GITHUB_WORKSPACE\build" -Filter "rme.exe" | Select-Object -First 1
if (-not $exePath) {
Write-Error "Not found rme.exe!"
exit 1
}
Copy-Item $exePath.FullName -Destination $artifactDir
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: rme-windows
path: artifacts/