Skip to content

Commit da8e688

Browse files
committed
Setup GitHub Actions for CMake
1 parent df5e2a2 commit da8e688

File tree

2 files changed

+61
-4
lines changed

2 files changed

+61
-4
lines changed

.github/workflows/codeql.yml

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
schedule:
99
- cron: '22 0 * * 1'
1010

11+
env:
12+
USERNAME: uvcat7
13+
FEED_URL: https://nuget.pkg.github.com/uvcat7/index.json
14+
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/uvcat7/index.json,readwrite"
15+
1116
jobs:
1217
analyze:
1318
name: Analyze (${{ matrix.language }})
@@ -30,9 +35,12 @@ jobs:
3035
- language: actions
3136
build-mode: none
3237
- language: c-cpp
33-
build-mode: autobuild
34-
- language: python
35-
build-mode: none
38+
build-mode: manual
39+
configure: >
40+
cmake -Bbuild
41+
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake"
42+
-DVCPKG_TARGET_TRIPLET=x64-windows-static-md
43+
build: cmake --build build --parallel "$env:NUMBER_OF_PROCESSORS"
3644

3745
steps:
3846
- name: Checkout repository
@@ -48,6 +56,29 @@ jobs:
4856
languages: ${{ matrix.language }}
4957
build-mode: ${{ matrix.build-mode }}
5058

59+
- name: Add NuGet sources
60+
shell: pwsh
61+
if: matrix.language == 'c-cpp'
62+
run: |
63+
.$(vcpkg fetch nuget) `
64+
sources add `
65+
-Source "${{ env.FEED_URL }}" `
66+
-StorePasswordInClearText `
67+
-Name GitHubPackages `
68+
-UserName "${{ env.USERNAME }}" `
69+
-Password "${{ secrets.GH_PACKAGES_TOKEN }}"
70+
.$(vcpkg fetch nuget) `
71+
setapikey "${{ secrets.GH_PACKAGES_TOKEN }}" `
72+
-Source "${{ env.FEED_URL }}"
73+
74+
- name: Configure
75+
if: matrix.configure
76+
run: ${{ matrix.configure }}
77+
78+
- name: Build
79+
if: matrix.build
80+
run: ${{ matrix.build }}
81+
5182
- name: Perform CodeQL Analysis
5283
uses: github/codeql-action/analyze@v3
5384
with:

.github/workflows/windows.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
paths-ignore:
77
- '**.md'
88

9+
env:
10+
USERNAME: uvcat7
11+
FEED_URL: https://nuget.pkg.github.com/uvcat7/index.json
12+
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/uvcat7/index.json,readwrite"
13+
914
jobs:
1015
windows:
1116
name: "Build Windows x64"
@@ -22,8 +27,29 @@ jobs:
2227
curl https://www.rarewares.org/files/ogg/oggenc2.88-1.3.7-x64.zip --output oggenc.zip &&
2328
unzip oggenc.zip -d bin/
2429
shell: bash
30+
- name: Add NuGet sources
31+
shell: pwsh
32+
run: |
33+
.$(vcpkg fetch nuget) `
34+
sources add `
35+
-Source "${{ env.FEED_URL }}" `
36+
-StorePasswordInClearText `
37+
-Name GitHubPackages `
38+
-UserName "${{ env.USERNAME }}" `
39+
-Password "${{ secrets.GH_PACKAGES_TOKEN }}"
40+
.$(vcpkg fetch nuget) `
41+
setapikey "${{ secrets.GH_PACKAGES_TOKEN }}" `
42+
-Source "${{ env.FEED_URL }}"
43+
- name: Configure CMake
44+
run: >
45+
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release
46+
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake"
47+
-DVCPKG_TARGET_TRIPLET=x64-windows-static-md
2548
- name: Build AV
26-
run: msbuild build\VisualStudio\ArrowVortex.vcxproj /p:Configuration=Release /p:Platform=x64
49+
run: cmake --build build --config Release --parallel "$env:NUMBER_OF_PROCESSORS"
50+
- name: Collect into a directory
51+
if: github.ref_name == 'beta'
52+
run: cmake --install build --config Release --prefix ./
2753
- name: Upload artifact
2854
if: github.ref_name == 'beta'
2955
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)