14
14
- ' documentation/**'
15
15
jobs :
16
16
Build :
17
- runs-on : windows-latest
17
+ # This will:
18
+ # - use windows-quick (self-hosted only) for release tags on this repo
19
+ # - use windows-2022 (self-hosted or GitHub-hosted depending on what's available) for development in this repo
20
+ # - use windows-latest (GitHub-hosted only) in all other cases (i.e. community contributions)
21
+ # Note: the reason we use windows-2022 instead of windows-latest is so that both the self-hosted runner
22
+ # (which has the windows-2022 label but NOT the windows-latest label) and the GitHub hosted runner are
23
+ # treated as candidates. We will never have a windows-latest self-hosted runner even if it is the latest.
24
+ runs-on : ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') && 'windows-quick' || github.repository == 'dotnet/Silk.NET' && 'windows-2022' || 'windows-latest' }}
18
25
steps :
19
26
- uses : actions/checkout@v2
20
27
with :
24
31
with :
25
32
java-version : 11
26
33
distribution : " temurin"
34
+ - name : Setup .NET 7.0
35
+ uses : actions/setup-dotnet@v1
36
+ with :
37
+ dotnet-version : 7.0.102
27
38
- name : Setup .NET 6.0
28
39
uses : actions/setup-dotnet@v1
29
40
with :
@@ -36,27 +47,25 @@ jobs:
36
47
uses : actions/setup-dotnet@v1
37
48
with :
38
49
dotnet-version : 3.1.404
39
- - name : Setup NUKE
40
- run : dotnet tool install Nuke.GlobalTool --global
41
50
- name : Install Workloads
42
51
# TODO: This is slow. Maybe we can make a docker container with this already done?
43
52
run : dotnet workload install android ios maccatalyst maui
44
53
- name : Test
45
54
if : ${{ github.repository != 'dotnet/Silk.NET' || !startsWith(github.ref, 'refs/tags/') }}
46
55
# skip Clean, Restore, and Compile as this will build the affect the whole solution.
47
56
# dotnet test will compile the necessary projects for testing only.
48
- run : nuke Test --skip Clean Restore Compile
57
+ run : .\build.cmd Test --skip Clean Restore Compile
49
58
- name : Validation Checks
50
59
if : ${{ github.repository != 'dotnet/Silk.NET' || !startsWith(github.ref, 'refs/tags/') }}
51
- run : nuke ValidateSolution
60
+ run : .\build.cmd ValidateSolution
52
61
- name : Pack (CI)
53
62
if : ${{ github.repository != 'dotnet/Silk.NET' || !startsWith(github.ref, 'refs/tags/') }}
54
63
# TODO build native mixins such as BuildLibSilkDroid
55
- run : nuke Pack --configuration Release --msbuild-properties VersionSuffix=build${{ github.run_number }}.0 ContinuousIntegrationBuild=true
64
+ run : .\build.cmd Pack --configuration Release --msbuild-properties VersionSuffix=build${{ github.run_number }}.0 ContinuousIntegrationBuild=true
56
65
- name : Pack (CD)
57
66
if : ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') }}
58
67
# TODO build native mixins such as BuildLibSilkDroid
59
- run : nuke Pack --configuration Release --msbuild-properties ContinuousIntegrationBuild=true
68
+ run : .\build.cmd Pack --configuration Release --msbuild-properties ContinuousIntegrationBuild=true
60
69
- name : Upload Unsigned Artifacts to Actions
61
70
62
71
with :
@@ -66,13 +75,13 @@ jobs:
66
75
retention-days : 1
67
76
- name : Sign Packages
68
77
if : ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') }}
69
- run : nuke SignPackages --sign-username "${{ secrets.SIGN_USERNAME }}" --sign-password "${{ secrets.SIGN_PASSWORD }}"
78
+ run : .\build.cmd SignPackages --sign-username "${{ secrets.SIGN_USERNAME }}" --sign-password "${{ secrets.SIGN_PASSWORD }}"
70
79
- name : Push to Azure Experimental Feed
71
80
if : ${{ github.repository == 'dotnet/Silk.NET' && github.event_name != 'pull_request' }}
72
- run : nuke PushToNuGet --skip Clean Restore Compile Pack --nuget-feed https://pkgs.dev.azure.com/UltzOS/Silk.NET/_packaging/Experimental/nuget/v3/index.json --nuget-username ${{ secrets.AZDO_ARTIFACTS_USERNAME }} --nuget-password ${{ secrets.AZDO_ARTIFACTS_TOKEN }} --nuget-api-key az
81
+ run : .\build.cmd PushToNuGet --skip Clean Restore Compile Pack --nuget-feed https://pkgs.dev.azure.com/UltzOS/Silk.NET/_packaging/Experimental/nuget/v3/index.json --nuget-username ${{ secrets.AZDO_ARTIFACTS_USERNAME }} --nuget-password ${{ secrets.AZDO_ARTIFACTS_TOKEN }} --nuget-api-key az
73
82
- name : Push to GitHub Packages
74
83
if : ${{ github.repository == 'dotnet/Silk.NET' && github.event_name != 'pull_request' }}
75
- run : nuke PushToNuGet --skip Clean Restore Compile Pack --nuget-feed https://nuget.pkg.github.com/dotnet/index.json --nuget-api-key ${{ secrets.GITHUB_TOKEN }}
84
+ run : .\build.cmd PushToNuGet --skip Clean Restore Compile Pack --nuget-feed https://nuget.pkg.github.com/dotnet/index.json --nuget-api-key ${{ secrets.GITHUB_TOKEN }}
76
85
- name : Upload Signed Artifacts to Actions
77
86
if : ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') }}
78
87
82
91
if-no-files-found : warn
83
92
- name : Push to NuGet
84
93
if : ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') }}
85
- run : nuke PushToNuGet --skip Clean Restore Pack --nuget-api-key ${{ secrets.NUGET_TOKEN }}
94
+ run : .\build.cmd PushToNuGet --skip Clean Restore Pack --nuget-api-key ${{ secrets.NUGET_TOKEN }}
86
95
0 commit comments