-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (96 loc) · 3.24 KB
/
ccpp.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
106
107
108
name: C/C++ CI
on:
push:
pull_request:
jobs:
job_build_cpp:
name: ${{ matrix.os }}-${{ matrix.buildConfig }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
include:
- os: windows-latest
buildConfig: release
displayName: tf47_echelon_windows
triplet: x64-windows-static
configuration: 'x64.*'
installPath: 'install/bin/'
- os: ubuntu-latest
buildConfig: release
displayName: tf47_echelon_ubuntu
triplet: x64-linux
configuration: 'x64.*'
installPath: 'install/lib/'
steps:
- name: Use gcc-9/g++-9 on ubuntu
run: |
echo "CC=gcc-9" >> $GITHUB_ENV
echo "CXX=g++-9" >> $GITHUB_ENV
shell: bash
if: matrix.os == 'ubuntu-latest'
# Checkout
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
# Install latest CMake
- uses: lukka/get-cmake@latest
# Setup vcpkg and build deps
- name: Restore artifacts, or Run vcpkg, build and cache artifacts
uses: lukka/run-vcpkg@v5
id: runvcpkg
with:
#setupOnly: true
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
vcpkgTriplet: '${{ matrix.triplet }}'
vcpkgArguments: 'cpr boost-program-options boost-property-tree boost-iostreams nlohmann-json'
vcpkgGitCommitId: 'acb6b10e7fdf5e8519c18398d0b069e1d58ca025'
# Build with CMake and Ninja
- name: Run CMake+Ninja
uses: lukka/run-cmake@v3
id: runcmake
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
buildWithCMakeArgs: ' -- install -v'
buildDirectory: '${{ runner.workspace }}/b/ninja/'
cmakeAppendedArgs: '-G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install -CMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake'
useVcpkgToolchainFile: true
buildWithCMake: true
# Build the mod
- uses: gruppe-adler/action-release-with-hemtt@60f7195e5240289fecd07c29cc5ec8fd92ad2159
name: 'Build Mod with HEMTT'
id: build
# Upload the mod
- uses: actions/upload-artifact@v1
with:
name: ${{ matrix.displayName }}
path: ${{ steps.build.outputs.release_path }}
job_release:
runs-on: windows-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: [job_build_cpp]
steps:
# Download the build mod
- name: Download windows build
uses: actions/download-artifact@v2
with:
name: tf47_echelon_windows
- name: Download ubuntu build
uses: actions/download-artifact@v2
with:
name: tf47_echelon_ubuntu
# zip it
- uses: papeloto/action-zip@v1
with:
files: \@tf47_intercept_template/
dest: \@tf47_intercept_template.zip
# release it
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
files: |
\@tf47_echelon.zip