-
-
Notifications
You must be signed in to change notification settings - Fork 212
77 lines (74 loc) · 2.79 KB
/
CI.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
name: CI
on:
push:
branches: [ master, develop ]
paths:
- .github/workflows/CI.yml
- mp/src/**
pull_request:
branches: [ master, develop ]
paths:
- .github/workflows/CI.yml
- mp/src/**
jobs:
build-windows:
runs-on: windows-latest
env:
POWERSHELL_TELEMETRY_OPTOUT: 1
steps:
- uses: actions/checkout@v2
- name: Generate VS solution
working-directory: mp\src
run: |
reg add "HKLM\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\10.0\Projects\{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}" /v DefaultProjectExtension /t REG_SZ /d vcproj /f
.\devtools\bin\vpc.exe /momentum +everything /mksln everything.sln
gc .\sln_fix.txt | ac .\everything.sln
- uses: microsoft/setup-msbuild@v1
- name: Build
run: msbuild mp\src\everything.sln /m /nologo /p:Configuration=Release /t:"Clean;Build" /v:m
- name: Prepare artifacts
id: prepare_artifacts
run: |
robocopy mp\game\bin artifacts\bin\bin /xf *.pdb /r:0 /w:0
robocopy mp\game\momentum\bin artifacts\bin\momentum\bin /xf *.pdb /r:0 /w:0
robocopy mp\game\bin artifacts\pdb\bin *.pdb /r:0 /w:0
robocopy mp\game\momentum\bin artifacts\pdb\momentum\bin *.pdb /r:0 /w:0
If ($LastExitCode -le 7) { echo "LastExitCode = $LastExitCode";$LastExitCode = 0 }
echo "::set-output name=short_commit_sha::$(git rev-parse --short HEAD)"
- name: Upload bin artifacts
uses: actions/upload-artifact@v2
with:
name: bin_${{ runner.os }}-${{ steps.prepare_artifacts.outputs.short_commit_sha }}
path: artifacts\bin
if-no-files-found: error
- name: Upload pdb artifacts
uses: actions/upload-artifact@v2
with:
name: pdb_${{ runner.os }}-${{ steps.prepare_artifacts.outputs.short_commit_sha }}
path: artifacts\pdb
if-no-files-found: error
build-linux:
runs-on: ubuntu-latest
container: scell555/steam-runtime-gcc-9:momentum
env:
USING_DOCKER: true
steps:
- uses: actions/checkout@v1
- name: Creating game project files
working-directory: mp/src
run: ./creategameprojects
- name: Building the game
working-directory: mp/src
run: make -j$(nproc --all) -f games.mak all-targets
- name: Prepare artifacts
id: prepare_artifacts
shell: bash
run: |
mkdir -v artifacts
shopt -s extglob
mv -v mp/game/bin/!(*.dbg) mp/game/momentum/bin/!(*.dbg|*.dll) artifacts
echo "::set-output name=short_commit_sha::$(git rev-parse --short HEAD)"
- uses: actions/upload-artifact@v1
with:
name: bin_${{ runner.os }}-${{ steps.prepare_artifacts.outputs.short_commit_sha }}
path: artifacts