-
Notifications
You must be signed in to change notification settings - Fork 2
101 lines (88 loc) · 2.97 KB
/
build.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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 }}
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 /p:GitBranch=${{ github.ref }} /p:GitCommitHash=${{ github.sha }} %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 }}
path: ${{ github.workspace }}/publish/KeySwitchManager.WPF*/