Skip to content

build

build #8

Workflow file for this run

name: build
env:
DOTNET_SDK_VERSION: '7.0.*'
on:
workflow_call:
inputs:
build-app-kind:
required: false
type: string
default: "CLI, WPF"
build-configuration:
required: true
type: string
custom-suffix:
required: false
type: string
workflow_dispatch:
inputs:
build-app-kind:
description: "Kind of Application"
required: false
type: string
default: "CLI, WPF"
build-configuration:
description: "Build configuration for msbuild"
required: true
type: choice
options:
- Debug
- Release
custom-suffix:
description: "Custom suffix for artifact name"
required: false
type: string
default: ""
jobs:
#--------------------------------------------------------------
# CLI
#--------------------------------------------------------------
cli-build:
if: contains(inputs.build-app-kind, 'CLI')
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
- name: CLI Build
run: dotnet msbuild /nologo /t:Archive /p:Configuration=${{ inputs.build-configuration }} /p:PublishDir=${{ github.workspace }}/publish /p:GitBranch=${{ github.ref }} /p:GitCommitHash=${{ github.sha }} $ProjectFile
shell: bash
env:
ProjectFile: KeySwitchManager/Sources/Runtime/Applications/CLI/publish.msbuild
- name: Artifact CLI
uses: actions/upload-artifact@v3
with:
name: KeySwitchManager.CLI-${{ inputs.build-configuration }}${{ inputs.custom-suffix }}-${{ github.sha }}
path: ${{ github.workspace }}/publish/KeySwitchManager.CLI*/
#--------------------------------------------------------------
# WPF
#--------------------------------------------------------------
wpf-build:
if: contains(inputs.build-app-kind, 'WPF')
runs-on: windows-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
- name: WPF Build
run: dotnet msbuild /nologo /t:Archive /p:Configuration=${{ inputs.build-configuration }} /p:PublishDir=${{ github.workspace }}/publish %ProjectFile%
shell: cmd
env:
ProjectFile: KeySwitchManager/Sources/Runtime/Applications/WPF/publish.msbuild
- name: Artifact WPF
uses: actions/upload-artifact@v3
with:
name: KeySwitchManager.WPF-${{ inputs.build-configuration }}${{ inputs.custom-suffix }}-${{ github.sha }}
path: ${{ github.workspace }}/publish/KeySwitchManager.WPF*/