Skip to content

Windows Build

Windows Build #7

Workflow file for this run

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"
new_release_version:
type: string
required: false
# 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"
new_release_version:
type: string
required: false
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: RTEA.sln
NAME_MAPPING: |
{
"Final": "Cortex Command",
"Debug Release": "Cortex Command.debug.release",
"Debug Minimal": "Cortex Command.debug.minimal",
"Debug Full": "Cortex Command.debug.full"
}
jobs:
build:
name: Windows Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Set Version
if: ${{inputs.new_release_version}}
uses: ./.github/actions/set_version
with:
new_release_version: ${{inputs.new_release_version}}
github_token: ${{ secrets.GITHUB_TOKEN }}
- 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@v4
with:
name: ${{ steps.executable_name.outputs.EXECUTABLE_NAME }}
path: ${{ steps.executable_name.outputs.EXECUTABLE_NAME }}.*
if-no-files-found: error