Skip to content

Commit 3f39401

Browse files
Perkseydotnet-bot
andauthored
[3.0] Bring back some of the build infrastructure (#2386)
* Bring back some of the build infrastructure * Add experimental feed to the workflow? * Revert to non-xlarge for now, we'll need this later though * Add missing scope for GitHub Packages * Central Package Management * Add metapackage, add Release job to workflow, more changes * Prepare for a release dry run * Fix bad usage of download-artifact * Fix artifact usage again and use SSH for push * Configure SSH key in checkout action instead * Fix incorrect VersionSuffix, workaround strange NUKE bug * Normalize markdown for announcement, update changelog for next release * Fix compilation error * Fix token-related errors * Update public API and changelog for next release * Revert "Update public API and changelog for next release" This reverts commit c0663f0. * Confident this is working now * Document! * Delete old SignService file --------- Co-authored-by: The Silk.NET Automaton <9011267+dotnet-bot@users.noreply.github.com>
1 parent 800bf83 commit 3f39401

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3341
-13788
lines changed

.github/workflows/dotnet.yml

Lines changed: 65 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,20 @@ on:
33
push:
44
pull_request:
55
merge_group:
6+
workflow_dispatch:
7+
inputs:
8+
release:
9+
description: "Release to NuGet"
10+
required: false
11+
type: boolean
12+
default: false
613
permissions:
714
statuses: write
815
checks: write
916
contents: write
1017
pull-requests: write
1118
actions: write
19+
packages: write
1220
jobs:
1321
Build:
1422
runs-on: macos-latest
@@ -17,12 +25,29 @@ jobs:
1725
- name: Setup .NET
1826
uses: actions/setup-dotnet@v3
1927
with:
20-
dotnet-version: '8.0.x'
28+
dotnet-version: '9.0.x'
2129
dotnet-quality: 'preview'
22-
- name: Restore
23-
run: dotnet restore
2430
- name: Pack
25-
run: dotnet pack -c Release
31+
# TODO decide whether we want experimental builds to use Debug or Release - using Release for now...
32+
run: >-
33+
dotnet run --project eng/build/Silk.NET.NUKE.csproj -c Release --
34+
Pack
35+
--configuration Release
36+
--msbuild-properties
37+
${{ github.event_name == 'workflow_dispatch' && inputs.release && 'ContinuousIntegrationBuild=true' || github.event_name != 'pull_request' && format('ContinuousIntegrationBuild=true VersionSuffix=build{0}.0', github.run_number) || format('ContinuousIntegrationBuild=true VersionSuffix=pr{0}.{1}', github.event.number, github.run_number) }}
38+
- name: Upload Unsigned Artifacts to Actions
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: unsigned_nupkgs
42+
path: "artifacts/**/*nupkg"
43+
if-no-files-found: warn
44+
retention-days: 1
45+
- name: Push to Experimental Feed
46+
if: ${{ github.repository == 'dotnet/Silk.NET' }}
47+
run: ./build.sh PushToNuGet --skip Clean Compile Pack --nuget-feed https://dotnet.github.io/Silk.NET/nuget/experimental/index.json --nuget-username ${{ secrets.EXP_NUGET_USERNAME }} --nuget-password ${{ secrets.EXP_NUGET_PASSWORD }} --nuget-api-key ${{ secrets.EXP_NUGET_PASSWORD }}
48+
- name: Push to GitHub Packages
49+
if: ${{ github.repository == 'dotnet/Silk.NET' }}
50+
run: ./build.sh PushToNuGet --skip Clean Compile Pack --nuget-feed https://nuget.pkg.github.com/dotnet/index.json --nuget-api-key ${{ secrets.GITHUB_TOKEN }}
2651
Test:
2752
strategy:
2853
fail-fast: false
@@ -57,18 +82,19 @@ jobs:
5782
path: ./coverage/**/*.trx
5883
reporter: dotnet-trx
5984
- name: Upload Coverage Results
60-
uses: actions/upload-artifact@v3
85+
uses: actions/upload-artifact@v4
6186
with:
6287
name: coverage-${{ matrix.name }}
6388
path: ./coverage/**/coverage.cobertura.xml
6489
Report-Coverage:
90+
name: "Report Coverage"
6591
runs-on: ubuntu-latest
6692
needs: Test
6793
permissions:
6894
pull-requests: write
6995
checks: write
7096
steps:
71-
- uses: actions/download-artifact@v3
97+
- uses: actions/download-artifact@v4
7298
with:
7399
path: ./coverage
74100
- name: Setup .NET Core
@@ -88,3 +114,36 @@ jobs:
88114
with:
89115
path: coveragereport/Cobertura.xml
90116
minimum_coverage: 0
117+
Release:
118+
runs-on: windows-latest
119+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.release }}
120+
needs: [Build, Test]
121+
environment: Release
122+
steps:
123+
- uses: actions/checkout@v3
124+
with:
125+
ssh-key: ${{ secrets.SILK_ACTIONS_DEPLOY_KEY }}
126+
- uses: actions/download-artifact@v4
127+
with:
128+
name: unsigned_nupkgs
129+
path: artifacts
130+
- name: Push to NuGet
131+
if: ${{ github.repository == 'dotnet/Silk.NET' }}
132+
run: >-
133+
.\build.cmd SignPackages PushToNuGet FinishRelease --skip Clean Compile Pack
134+
--nuget-api-key ${{ secrets.NUGET_TOKEN }}
135+
--akv-certificate ${{ secrets.AKV_CERTIFICATE }}
136+
--akv-client-id ${{ secrets.AKV_CLIENT_ID }}
137+
--akv-client-secret ${{ secrets.AKV_CLIENT_SECRET }}
138+
--akv-tenant ${{ secrets.AKV_TENANT }}
139+
--akv-vault-url ${{ secrets.AKV_VAULT_URL }}
140+
--discord-webhook ${{ secrets.DISCORD_ANNOUNCEMENT_WEBHOOK }}
141+
env:
142+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143+
- name: Upload Signed Artifacts to Actions
144+
uses: actions/upload-artifact@v4
145+
with:
146+
name: signed_nupkgs
147+
path: "artifacts/**/*nupkg"
148+
if-no-files-found: warn
149+
retention-days: 30

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ src/**/build/
475475
*.gen.txt
476476

477477
# Silk.NET Website Generation Output
478-
/docs/
478+
#/docs/
479479
src/Website/Silk.NET.Statiq/temp
480480
src/Website/Silk.NET.Statiq/cache
481481

.nuke/build.schema.json

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"definitions": {
4+
"Host": {
5+
"type": "string",
6+
"enum": [
7+
"AppVeyor",
8+
"AzurePipelines",
9+
"Bamboo",
10+
"Bitbucket",
11+
"Bitrise",
12+
"GitHubActions",
13+
"GitLab",
14+
"Jenkins",
15+
"Rider",
16+
"SpaceAutomation",
17+
"TeamCity",
18+
"Terminal",
19+
"TravisCI",
20+
"VisualStudio",
21+
"VSCode"
22+
]
23+
},
24+
"ExecutableTarget": {
25+
"type": "string",
26+
"enum": [
27+
"Clean",
28+
"Compile",
29+
"DeclareApi",
30+
"Pack",
31+
"Prerequisites",
32+
"PushToNuGet",
33+
"RegenerateBindings",
34+
"ShipApi",
35+
"SignPackages"
36+
]
37+
},
38+
"Verbosity": {
39+
"type": "string",
40+
"description": "",
41+
"enum": [
42+
"Verbose",
43+
"Normal",
44+
"Minimal",
45+
"Quiet"
46+
]
47+
},
48+
"NukeBuild": {
49+
"properties": {
50+
"Continue": {
51+
"type": "boolean",
52+
"description": "Indicates to continue a previously failed build attempt"
53+
},
54+
"Help": {
55+
"type": "boolean",
56+
"description": "Shows the help text for this build assembly"
57+
},
58+
"Host": {
59+
"description": "Host for execution. Default is 'automatic'",
60+
"$ref": "#/definitions/Host"
61+
},
62+
"NoLogo": {
63+
"type": "boolean",
64+
"description": "Disables displaying the NUKE logo"
65+
},
66+
"Partition": {
67+
"type": "string",
68+
"description": "Partition to use on CI"
69+
},
70+
"Plan": {
71+
"type": "boolean",
72+
"description": "Shows the execution plan (HTML)"
73+
},
74+
"Profile": {
75+
"type": "array",
76+
"description": "Defines the profiles to load",
77+
"items": {
78+
"type": "string"
79+
}
80+
},
81+
"Root": {
82+
"type": "string",
83+
"description": "Root directory during build execution"
84+
},
85+
"Skip": {
86+
"type": "array",
87+
"description": "List of targets to be skipped. Empty list skips all dependencies",
88+
"items": {
89+
"$ref": "#/definitions/ExecutableTarget"
90+
}
91+
},
92+
"Target": {
93+
"type": "array",
94+
"description": "List of targets to be invoked. Default is '{default_target}'",
95+
"items": {
96+
"$ref": "#/definitions/ExecutableTarget"
97+
}
98+
},
99+
"Verbosity": {
100+
"description": "Logging verbosity during build execution. Default is 'Normal'",
101+
"$ref": "#/definitions/Verbosity"
102+
}
103+
}
104+
}
105+
},
106+
"allOf": [
107+
{
108+
"properties": {
109+
"AkvCertificate": {
110+
"type": "string",
111+
"description": "Code-signing service Azure Key Vault certificate"
112+
},
113+
"AkvClientId": {
114+
"type": "string",
115+
"description": "Code-signing service Azure Key Vault client ID"
116+
},
117+
"AkvClientSecret": {
118+
"type": "string",
119+
"description": "Code-signing service Azure Key Vault client secret"
120+
},
121+
"AkvTenant": {
122+
"type": "string",
123+
"description": "Code-signing service Azure Key Vault tenant ID"
124+
},
125+
"AkvVaultUrl": {
126+
"type": "string",
127+
"description": "Code-signing service Azure Key Vault URL"
128+
},
129+
"Configuration": {
130+
"type": "string",
131+
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
132+
"enum": [
133+
"Debug",
134+
"Release"
135+
]
136+
},
137+
"MsbuildProperties": {
138+
"type": "array",
139+
"description": "Extra properties passed to MSBuild commands",
140+
"items": {
141+
"type": "string"
142+
}
143+
},
144+
"NugetApiKey": {
145+
"type": "string",
146+
"description": "The API key used to push packages and symbols packages to NuGet"
147+
},
148+
"NugetFeed": {
149+
"type": "string",
150+
"description": "NuGet feed"
151+
},
152+
"NugetNoServiceEndpoint": {
153+
"type": "boolean",
154+
"description": "NuGet -NoServiceEndpoint"
155+
},
156+
"NugetPassword": {
157+
"type": "string",
158+
"description": "NuGet password"
159+
},
160+
"NugetUsername": {
161+
"type": "string",
162+
"description": "NuGet username"
163+
},
164+
"SilkTouchAdditionalArgs": {
165+
"type": "array",
166+
"description": "Additional arguments to prepend to SilkTouch invocations",
167+
"items": {
168+
"type": "string"
169+
}
170+
},
171+
"Solution": {
172+
"type": "string",
173+
"description": "Path to a solution file that is automatically loaded"
174+
}
175+
}
176+
},
177+
{
178+
"$ref": "#/definitions/NukeBuild"
179+
}
180+
]
181+
}

.nuke/parameters.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "build.schema.json",
3+
"Solution": "Silk.NET.sln"
4+
}

Directory.Build.props

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
<SignAssembly>true</SignAssembly>
2929
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
3030
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
31+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
32+
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
3133
</PropertyGroup>
3234

3335
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
@@ -41,14 +43,12 @@
4143
<Company>.NET Foundation</Company>
4244
<PackageOutputPath>$(BaseArtifactsPath)pkg/$(BaseArtifactsPathSuffix)/$(Configuration)/</PackageOutputPath>
4345
<Product>Silk.NET</Product>
44-
<VersionPrefix>3.0.0</VersionPrefix>
45-
<VersionSuffix>alpha</VersionSuffix>
4646
</PropertyGroup>
4747

4848
<!-- Default settings that are otherwise undefined -->
4949
<PropertyGroup>
5050
<Copyright>Copyright © .NET Foundation and Contributors</Copyright>
51-
<Description>An experimental rewrite of Silk.NET and by extension SilkTouch - this is by no means 3.0 and if that is no longer the case this repo shall be merged with the main Silk.NET repo.</Description>
51+
<Description>Silk.NET is your one-stop-shop for high-speed .NET multimedia, graphics, and compute; providing bindings to popular low-level APIs such as OpenGL, OpenCL, OpenAL, OpenXR, SDL, Vulkan, Assimp, WebGPU, DirectX, and more!</Description>
5252
<Features>strict</Features>
5353
<GenerateDocumentationFile>true</GenerateDocumentationFile>
5454
<HighEntropyVA>true</HighEntropyVA>
@@ -60,6 +60,18 @@
6060
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
6161
<RepositoryType>git</RepositoryType>
6262
<UseSharedCompilation>true</UseSharedCompilation>
63+
<CheckEolWorkloads>false</CheckEolWorkloads>
64+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
65+
<VersionDependsOn>SilkShippingControl;$(VersionDependsOn)</VersionDependsOn>
66+
<PackageVersionDependsOn>SilkShippingControl;$(PackageVersionDependsOn)</PackageVersionDependsOn>
6367
</PropertyGroup>
6468

69+
<!-- SourceLink -->
70+
<PropertyGroup Condition="'$(SilkSourceLinkExempt)' == ''">
71+
<DebugType>portable</DebugType>
72+
<EmbedAllSources>true</EmbedAllSources>
73+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
74+
<IncludeSymbols>true</IncludeSymbols>
75+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
76+
</PropertyGroup>
6577
</Project>

0 commit comments

Comments
 (0)