Skip to content

Commit 30e26d0

Browse files
authored
Use a self-hosted runner (#1222)
* Test selfhosted runner * Update build.yml * Fix README data race * Use .NET 7 in Actions * Use .NET 7 in global.json * Test sign service on selfhosted runner * Update build.yml * Reserve the quick runner for Silk.NET team use only * Remove specific branch for testing * Use GitHub hosted runners if the self-hosted ones are busy * Always use self-hosted for releases
1 parent 10d15f6 commit 30e26d0

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ on:
1414
- 'documentation/**'
1515
jobs:
1616
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' }}
1825
steps:
1926
- uses: actions/checkout@v2
2027
with:
@@ -24,6 +31,10 @@ jobs:
2431
with:
2532
java-version: 11
2633
distribution: "temurin"
34+
- name: Setup .NET 7.0
35+
uses: actions/setup-dotnet@v1
36+
with:
37+
dotnet-version: 7.0.102
2738
- name: Setup .NET 6.0
2839
uses: actions/setup-dotnet@v1
2940
with:
@@ -36,27 +47,25 @@ jobs:
3647
uses: actions/setup-dotnet@v1
3748
with:
3849
dotnet-version: 3.1.404
39-
- name: Setup NUKE
40-
run: dotnet tool install Nuke.GlobalTool --global
4150
- name: Install Workloads
4251
# TODO: This is slow. Maybe we can make a docker container with this already done?
4352
run: dotnet workload install android ios maccatalyst maui
4453
- name: Test
4554
if: ${{ github.repository != 'dotnet/Silk.NET' || !startsWith(github.ref, 'refs/tags/') }}
4655
# skip Clean, Restore, and Compile as this will build the affect the whole solution.
4756
# 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
4958
- name: Validation Checks
5059
if: ${{ github.repository != 'dotnet/Silk.NET' || !startsWith(github.ref, 'refs/tags/') }}
51-
run: nuke ValidateSolution
60+
run: .\build.cmd ValidateSolution
5261
- name: Pack (CI)
5362
if: ${{ github.repository != 'dotnet/Silk.NET' || !startsWith(github.ref, 'refs/tags/') }}
5463
# 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
5665
- name: Pack (CD)
5766
if: ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') }}
5867
# 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
6069
- name: Upload Unsigned Artifacts to Actions
6170
uses: actions/[email protected]
6271
with:
@@ -66,13 +75,13 @@ jobs:
6675
retention-days: 1
6776
- name: Sign Packages
6877
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 }}"
7079
- name: Push to Azure Experimental Feed
7180
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
7382
- name: Push to GitHub Packages
7483
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 }}
7685
- name: Upload Signed Artifacts to Actions
7786
if: ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') }}
7887
uses: actions/[email protected]
@@ -82,5 +91,5 @@ jobs:
8291
if-no-files-found: warn
8392
- name: Push to NuGet
8493
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 }}
8695

build/props/common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
.Replace('<div>', '').Replace('</div>', '')
9696
.Replace('<a>', '').Replace('</a>', ''))
9797
</SilkReadme>
98-
<SilkReadmePath>$(IntermediateOutputPath)README.md</SilkReadmePath>
98+
<SilkReadmePath>$(IntermediateOutputPath)$(TargetFramework)/README.md</SilkReadmePath>
9999
</PropertyGroup>
100100
<PropertyGroup Condition="'$(SilkDescription)' != ''">
101101
<Description>$(SilkDescription) $(Description)</Description>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "6.0.201",
3+
"version": "7.0.102",
44
"rollForward": "major"
55
}
66
}

0 commit comments

Comments
 (0)