Windows Build #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |