-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (111 loc) · 4.08 KB
/
build.yml
File metadata and controls
127 lines (111 loc) · 4.08 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
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
124
125
126
127
name: Build
on:
push:
paths-ignore:
- "**/README.md"
env:
USERNAME: kwsp
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg
FEED_URL: https://nuget.pkg.github.com/kwsp/index.json
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite;nuget,https://nuget.pkg.github.com/kwsp/index.json,readwrite"
jobs:
Build-Win64:
runs-on: windows-2022
steps:
- 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 || '');
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup VCPKG
shell: pwsh
run: |
cd ${{ github.workspace }}
git clone https://github.com/microsoft/vcpkg
${{ github.workspace }}/vcpkg/bootstrap-vcpkg.bat
- name: Add NuGet sources
shell: pwsh
run: |
.$(${{ env.VCPKG_EXE }} fetch nuget) `
sources add `
-Source "${{ env.FEED_URL }}" `
-StorePasswordInClearText `
-Name GitHubPackages `
-UserName "${{ env.USERNAME }}" `
-Password "${{ secrets.GH_PACKAGES_TOKEN }}"
.$(${{ env.VCPKG_EXE }} fetch nuget) `
setapikey "${{ secrets.GH_PACKAGES_TOKEN }}" `
-Source "${{ env.FEED_URL }}"
- name: CMake configure
shell: pwsh
run: cmake --preset win64
- name: CMake build
shell: pwsh
run: cmake --build --preset win64-release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: artifact
path: ${{ github.workspace }}/build/win64/src/Release/main.exe
if-no-files-found: "warn" # output a warning if no files are found.
overwrite: true
Build-mac:
runs-on: macos-latest
steps:
- 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 || '');
- uses: actions/checkout@v4
with:
submodules: true
- name: Install system-wide build tools
shell: bash
# Install
# mono: NuGet requires a dotnet runtime
# ninja: Build system
# llvm: Just for clang-tidy. Need to add to path.
# Just add clang-tidy to path, not all of LLVM clang.
run: |
brew install mono ninja llvm
ln -s $(brew --prefix llvm)/bin/clang-tidy /usr/local/bin/clang-tidy
brew install autoconf autoconf-archive automake libtool
- name: Setup VCPKG
shell: bash
run: |
cd ${{ github.workspace }}
git clone https://github.com/microsoft/vcpkg
${{ github.workspace }}/vcpkg/bootstrap-vcpkg.sh
- name: Add NuGet sources
shell: bash
run: |
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \
sources add \
-Source "${{ env.FEED_URL }}" \
-StorePasswordInClearText \
-Name GitHubPackages \
-UserName "${{ env.USERNAME }}" \
-Password "${{ secrets.GH_PACKAGES_TOKEN }}"
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \
setapikey "${{ secrets.GH_PACKAGES_TOKEN }}" \
-Source "${{ env.FEED_URL }}"
- name: CMake configure
shell: bash
run: cmake --preset clang
- name: CMake build
shell: bash
run: cmake --build --preset clang-release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: artifact
path: ${{ github.workspace }}/build/clang/src/Release/main
if-no-files-found: "warn" # output a warning if no files are found.
overwrite: true