forked from KD-lab-Open-Source/Perimeter
-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (70 loc) · 3.24 KB
/
windows_msvc_build.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
name: Windows MSVC Build
on:
push:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
env:
VCPKG_COMMIT_ID: '21bbb14c4113b89cd06402e852e075341722304f'
buildDir: '${{ github.workspace }}/build/'
outDir: '${{ github.workspace }}/artifact/'
jobs:
build:
strategy:
matrix:
env: [
#{bits: 32, arch_installed: x86, build_type: Debug, arch_name: x86, arch: x86},
{bits: 64, arch_installed: x64, build_type: Debug, arch_name: x86, arch: amd64},
#{bits: 64, arch_installed: x64, build_type: Debug, arch_name: ARM, arch: amd64_arm64},
{bits: 32, arch_installed: x86, build_type: Release, arch_name: x86, arch: x86},
{bits: 64, arch_installed: x64, build_type: Release, arch_name: x86, arch: amd64},
#{bits: 64, arch_installed: x64, build_type: Release, arch_name: ARM, arch: amd64_arm64}
]
name: ${{matrix.env.build_type}} ${{matrix.env.arch_name}} ${{matrix.env.bits}} bits
if: github.event.pull_request.draft != true
env:
VCPKG_DEFAULT_TRIPLET: ${{matrix.env.arch}}-windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: lukka/get-cmake@latest
- name: Restore artifacts, or run vcpkg, build (and cache artifacts as post step)
uses: lukka/run-vcpkg@v11
id: runvcpkg
with:
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}'
vcpkgJsonGlob: 'vcpkg.json'
runVcpkgInstall: false
- name: Configure developer command prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{matrix.env.arch}}
- name: Run cmake to install the dependencies specified in the vcpkg.json, generate project file
run: |
mkdir ${{ env.buildDir }}
cd ${{ env.buildDir }}
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=${{matrix.env.build_type}} -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake ..
- name: Build the project
run: |
cd ${{ env.buildDir }}
nmake
- name: Prepare artifact folder
run: |
mkdir ${{ env.outDir }}
copy ${{ env.buildDir }}vcpkg_installed/${{matrix.env.arch_installed}}-windows/bin/ogg.dll ${{ env.outDir }}
copy ${{ env.buildDir }}vcpkg_installed/${{matrix.env.arch_installed}}-windows/bin/vorbis.dll ${{ env.outDir }}
copy ${{ env.buildDir }}vcpkg_installed/${{matrix.env.arch_installed}}-windows/bin/vorbisfile.dll ${{ env.outDir }}
copy ${{ env.buildDir }}vcpkg_installed/${{matrix.env.arch_installed}}-windows/bin/swscale-*.dll ${{ env.outDir }}
copy ${{ env.buildDir }}vcpkg_installed/${{matrix.env.arch_installed}}-windows/bin/swresample-*.dll ${{ env.outDir }}
copy ${{ env.buildDir }}Source/*.dll ${{ env.outDir }}
copy ${{ env.buildDir }}Source/*.exe ${{ env.outDir }}
copy ${{ env.buildDir }}Source/*.pdb ${{ env.outDir }}
#TODO fix MSVC builds
#- uses: actions/upload-artifact@v4
# with:
# name: Perimeter MSVC ${{matrix.env.build_type}} ${{matrix.env.arch_name}} ${{matrix.env.bits}} bits
# path: ${{ env.outDir }}