-
Notifications
You must be signed in to change notification settings - Fork 81
137 lines (115 loc) · 4 KB
/
build.yml
File metadata and controls
137 lines (115 loc) · 4 KB
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
133
134
135
136
137
# New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
# Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), tobitege et al. 2025 - 2025. All rights reserved.
name: Build
on:
pull_request:
branches: ['**']
types: [opened, synchronize, reopened]
push:
branches:
- master
- alpha
- canary
- gold
- V105-LTS
- V85-LTS
paths-ignore: ['.git*', '.vscode']
jobs:
build:
runs-on: windows-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Checkout
uses: actions/checkout@v6
# .NET 9 and 10
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
9.0.x
10.0.x
# global.json dynamically generate
- name: Force .NET 10 SDK via global.json
run: |
$sdkVersion = (dotnet --list-sdks | Select-String "10.0").ToString().Split(" ")[0]
Write-Output "Using SDK $sdkVersion"
@"
{
"sdk": {
"version": "$sdkVersion",
"rollForward": "latestFeature"
}
}
"@ | Out-File -Encoding utf8 global.json
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- name: Setup NuGet
uses: NuGet/setup-nuget@v2.0.1
- name: Cache NuGet
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore
run: dotnet restore "Source/Krypton Components/Krypton Toolkit Suite 2022 - VS2022.sln"
- name: Build
run: msbuild "Scripts/Build/nightly.proj" /t:Rebuild /p:Configuration=Release /p:Platform="Any CPU"
release:
runs-on: windows-latest
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
needs: build
steps:
- name: Checkout
uses: actions/checkout@v6
# .NET 9 and 10
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
9.0.x
10.0.x
# global.json dynamically generate
- name: Force .NET 10 SDK via global.json
run: |
$sdkVersion = (dotnet --list-sdks | Select-String "10.0").ToString().Split(" ")[0]
Write-Output "Using SDK $sdkVersion"
@"
{
"sdk": {
"version": "$sdkVersion",
"rollForward": "latestFeature"
}
}
"@ | Out-File -Encoding utf8 global.json
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- name: Setup NuGet
uses: NuGet/setup-nuget@v2.0.1
- name: Cache NuGet
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore
run: dotnet restore "Source/Krypton Components/Krypton Toolkit Suite 2022 - VS2022.sln"
- name: Build Release
run: msbuild "Scripts/Build/build.proj" /t:Build /p:Configuration=Release /p:Platform="Any CPU"
- name: Pack Release
run: msbuild "Scripts/Build/build.proj" /t:Pack /p:Configuration=Release /p:Platform="Any CPU"
- name: Get Version
id: get_version
run: |
$version = (dotnet build "Source/Krypton Components/Krypton.Toolkit/Krypton.Toolkit.csproj" --no-restore --verbosity quiet | Select-String "Version" | ForEach-Object { $_.Line.Split('=')[1].Trim() })
if (-not $version) {
$version = "100.25.1.1" # Fallback version
}
echo "version=$version" >> $env:GITHUB_OUTPUT
echo "tag=v$version" >> $env:GITHUB_OUTPUT