-
Notifications
You must be signed in to change notification settings - Fork 16
76 lines (67 loc) · 2.33 KB
/
msbuild.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
name: Windows Build
on:
# Triggers the workflow when manually dispatched
workflow_dispatch:
inputs:
upload_artefacts:
description: "Upload build artefacts"
type: boolean
required: false
default: false
build_configuration:
description: "Build Configuration"
type: choice
required: false
default: "Final"
options:
- "Final"
- "Debug Release"
- "Debug Minimal"
- "Debug Full"
# Triggers the workflow when called by a top-level workflow
workflow_call:
inputs:
upload_artefacts:
type: boolean
required: false
default: false
build_configuration: # "Final" | "Debug Release" | "Debug Minimal" | "Debug Full"
type: string
required: false
default: "Final"
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: RTEA.sln
NAME_MAPPING: |
{
"Final": "Cortex Command.exe",
"Debug Release": "Cortex Command.debug.release.exe",
"Debug Minimal": "Cortex Command.debug.minimal.exe",
"Debug Full": "Cortex Command.debug.full.exe"
}
jobs:
build:
name: Windows Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration="${{inputs.build_configuration}}" ${{env.SOLUTION_FILE_PATH}}
- name: Determine executable name
id: executable_name
if: ${{inputs.upload_artefacts}}
run: |
echo "EXECUTABLE_NAME=${{ fromJson(env.NAME_MAPPING)[inputs.build_configuration] }}" >> "$GITHUB_OUTPUT"
shell: bash
- name: Upload Artifact
if: ${{inputs.upload_artefacts}}
uses: actions/upload-artifact@v3
with:
name: ${{ steps.executable_name.outputs.EXECUTABLE_NAME }}
path: D:/a/Cortex-Command-Community-Project/Cortex-Command-Community-Project/${{ steps.executable_name.outputs.EXECUTABLE_NAME }}
if-no-files-found: error