-
Notifications
You must be signed in to change notification settings - Fork 2
132 lines (114 loc) · 4 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: build
env:
DOTNET_SDK_VERSION: '7.0.*'
on:
workflow_call:
inputs:
build-app-kind:
required: false
type: string
default: "CLI, WPF, Xamarin.Mac"
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, Xamarin.Mac"
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 $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*/
#--------------------------------------------------------------
# Xamarin.Mac
#--------------------------------------------------------------
xmarin-mac-build:
if: contains(inputs.build-app-kind, 'Xamarin.Mac')
runs-on: macos-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: Xamarin.Mac Build
run: dotnet msbuild /nologo /t:Archive /p:Configuration=${{ inputs.build-configuration }} /p:PublishDir=${{ github.workspace }}/publish $ProjectFile
shell: bash
env:
ProjectFile: KeySwitchManager/Sources/Runtime/Applications/Xamarin.Mac/publish.msbuild
- name: Artifact Xamarin.Mac
uses: actions/upload-artifact@v3
with:
name: KeySwitchManager.Xamarin.Mac-${{ inputs.build-configuration }}${{ inputs.custom-suffix }}-${{ github.sha }}
path: ${{ github.workspace }}/publish/KeySwitchManager.Xamarin.Mac*/