forked from gwaldron/osgearth
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (90 loc) · 3.34 KB
/
windows.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
name: windows-x64-Release
on: [push, pull_request, workflow_dispatch]
env:
VCPKG_BINARY_SOURCES : 'clear;nuget,GitHub,readwrite'
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
VCPKG_VERSION: 'd417ae59d6e9aa20d9f812b5deb966645c54687d'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['windows-2019']
include:
- os: 'windows-2019'
triplet: 'x64-windows'
mono: ''
VCPKG_WORKSPACE: 'c:/vcpkg_own'
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: vcpkg cache
id: vcpkgcache
uses: actions/cache@v2
with:
path: |
${{ matrix.VCPKG_WORKSPACE }}
!${{ matrix.VCPKG_WORKSPACE }}/packages
!${{ matrix.VCPKG_WORKSPACE }}/buildtrees
!${{ matrix.VCPKG_WORKSPACE }}/downloads
key: vcpkg-${{ matrix.triplet }}-v2
- name: Installing vcpkg (windows)
if: steps.vcpkgcache.outputs.cache-hit != 'true'
shell: 'bash'
run: |
cmake -E make_directory ${{ matrix.VCPKG_WORKSPACE }}
cd ${{ matrix.VCPKG_WORKSPACE }}
# git clone --depth 1 --branch ${{env.VCPKG_VERSION}} https://github.com/microsoft/vcpkg
git clone https://github.com/microsoft/vcpkg
cd vcpkg
git checkout ${{env.VCPKG_VERSION}}
cd ..
./vcpkg/bootstrap-vcpkg.bat -disableMetrics
${{ matrix.VCPKG_WORKSPACE }}/vcpkg/vcpkg version
- name: 'Setup NuGet Credentials'
working-directory: ${{ matrix.VCPKG_WORKSPACE }}
shell: 'bash'
run: >
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
sources add
-source "https://nuget.pkg.github.com/${{ github.actor }}/index.json"
-storepasswordincleartext
-name "GitHub"
-username "${{ github.actor }}"
-password "${{ secrets.GITHUB_TOKEN }}"
# Omit this step if you're using manifests
- name: 'vcpkg package restore'
working-directory: ${{ matrix.VCPKG_WORKSPACE }}
shell: 'bash'
run: >
./vcpkg/vcpkg install osg curl gdal geos sqlite3 protobuf basisu draco glew --triplet ${{ matrix.triplet }}
- name: 'Upload library build log artifact'
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: osg-log
path: |
${{ env.VCPKG_WORKSPACE }}/vcpkg/buildtrees/osg/install-x64-windows-rel-err.log
${{ env.VCPKG_WORKSPACE }}/vcpkg/buildtrees/osg/install-x64-windows-rel-out.log
retention-days: 1
- name: Create Build Environment
run: |
cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{ runner.workspace }}/build
run: cmake $GITHUB_WORKSPACE -DWIN32_USE_MP=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=${{ matrix.VCPKG_WORKSPACE }}/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: 'Upload cmake configure log artifact'
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: cmake-log
path: |
${{ runner.workspace }}/build/CMakeCache.txt
retention-days: 1
- name: Build
working-directory: ${{ runner.workspace }}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE