Skip to content

Commit 46b388a

Browse files
Perkseycurin
andauthored
Use the 3.0 branch for the 2.X website build (#2414)
* Start of shifting files around for new website * More work on multi-versioning * Fix bad notes * Delete the old website * Fix paths for 2.X * Delete Statiq, add a NUKE target for building the new site in 2.X, other tweaks * Update the submodule in the 3.0 branch for the 2.X branch * Apply suggestions from code review Co-authored-by: Andrew Davis <curin@dbtgaming.com> * Use a deploy key instead --------- Co-authored-by: Andrew Davis <curin@dbtgaming.com>
1 parent 915c245 commit 46b388a

File tree

170 files changed

+405
-39178
lines changed

Some content is hidden

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

170 files changed

+405
-39178
lines changed

.github/workflows/publish-site.yml

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,27 @@ on:
33
push:
44
branches:
55
- 'main'
6+
paths:
7+
- "documentation/**/*"
68
permissions:
79
contents: read
810
pages: write
911
id-token: write
1012
jobs:
1113
Build:
14+
environment: github-pages
1215
runs-on: ubuntu-latest
1316
steps:
1417
- uses: actions/checkout@v2
15-
- name: Setup .NET 5.0
16-
uses: actions/setup-dotnet@v1
1718
with:
18-
dotnet-version: 5.0.401
19-
- name: Setup .NET 6.0
20-
uses: actions/setup-dotnet@v1
21-
with:
22-
dotnet-version: 6.0.201
23-
- name: Setup .NET 7.0
24-
uses: actions/setup-dotnet@v1
25-
with:
26-
dotnet-version: 7.0.102
27-
- name: Run Statiq
28-
run: dotnet run -c Release --project src/Website/Silk.NET.Statiq/Silk.NET.Statiq.csproj -- -l debug --nocache
29-
- name: Upload artifact
30-
uses: actions/upload-pages-artifact@v1
31-
with:
32-
path: "docs"
33-
Deploy:
34-
environment:
35-
name: github-pages
36-
url: ${{ steps.deployment.outputs.page_url }}
37-
runs-on: ubuntu-latest
38-
needs: Build
39-
steps:
40-
- name: Deploy to GitHub Pages
41-
id: deployment
42-
uses: actions/deploy-pages@v1
19+
ref: "develop/3.0"
20+
ssh-key: ${{ secrets.SILK_ACTIONS_DEPLOY_KEY }}
21+
- run: |
22+
git submodule update --init --recommend-shallow eng/submodules/silk.net-2.x
23+
cd eng/submodules/silk.net-2.x
24+
git fetch origin main
25+
git checkout FETCH_HEAD
26+
cd ../../..
27+
git add eng/submodules/silk.net-2.x
28+
git commit -m "Update Silk.NET 2.X submodule for website"
29+
git push

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,3 +481,6 @@ src/Website/Silk.NET.Statiq/cache
481481

482482
# As much as I love Mac, really not interested in this litter.
483483
**/.DS_Store
484+
485+
website/
486+
version.txt

.nuke/build.schema.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
"type": "boolean",
3131
"description": "If specified, ignores any generated solution present and builds the entire project"
3232
},
33+
"AndroidHomeValue": {
34+
"type": "string",
35+
"description": "Android home. Will be determined from dotnet if not provided"
36+
},
3337
"Configuration": {
3438
"type": "string",
3539
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)"
@@ -136,16 +140,28 @@
136140
"type": "string"
137141
}
138142
},
143+
"PullBaseSite": {
144+
"type": "boolean",
145+
"description": "When enabled, pulls the latest changes for local clone of the 3.0 branch to build the website. Automatically true if the local clone doesn't exist yet"
146+
},
139147
"Root": {
140148
"type": "string",
141149
"description": "Root directory during build execution"
142150
},
151+
"SiteBuildArgs": {
152+
"type": "array",
153+
"description": "Arguments for website generation on the 3.0 branch",
154+
"items": {
155+
"type": "string"
156+
}
157+
},
143158
"Skip": {
144159
"type": "array",
145160
"description": "List of targets to be skipped. Empty list skips all dependencies",
146161
"items": {
147162
"type": "string",
148163
"enum": [
164+
"Angle",
149165
"Assimp",
150166
"BuildLibSilkDroid",
151167
"Clean",
@@ -176,6 +192,7 @@
176192
"ValidateSolution",
177193
"Vkd3d",
178194
"VulkanLoader",
195+
"Website",
179196
"Wgpu"
180197
]
181198
}
@@ -190,6 +207,7 @@
190207
"items": {
191208
"type": "string",
192209
"enum": [
210+
"Angle",
193211
"Assimp",
194212
"BuildLibSilkDroid",
195213
"Clean",
@@ -220,6 +238,7 @@
220238
"ValidateSolution",
221239
"Vkd3d",
222240
"VulkanLoader",
241+
"Website",
223242
"Wgpu"
224243
]
225244
}

Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<Project>
2+
</Project>

Directory.Build.targets

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<Project>
2+
</Project>

Silk.NET.sln

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -446,12 +446,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenGL Demos", "OpenGL Demo
446446
EndProject
447447
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AndroidDemo", "examples\CSharp\OpenGL Demos\AndroidDemo\AndroidDemo.csproj", "{380468AD-B44D-456C-8DED-35467D11AC2F}"
448448
EndProject
449-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Website", "Website", "{832251B9-B1A2-450A-8FB8-41F600CCA616}"
450-
EndProject
451-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.Statiq", "src\Website\Silk.NET.Statiq\Silk.NET.Statiq.csproj", "{49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}"
452-
EndProject
453-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.Statiq.TableOfContents", "src\Website\Silk.NET.Statiq.TableOfContents\Silk.NET.Statiq.TableOfContents.csproj", "{507ED409-A2FD-43BB-AC7C-778B92BD40CF}"
454-
EndProject
455449
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.DXVA", "src\Microsoft\Silk.NET.DXVA\Silk.NET.DXVA.csproj", "{28D863B1-B60C-4C08-8661-EB820A5B78D2}"
456450
EndProject
457451
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.Core.Win32Extras", "src\Core\Silk.NET.Core.Win32Extras\Silk.NET.Core.Win32Extras.csproj", "{3E30D674-9282-4297-AD1F-9B233A166308}"
@@ -2843,30 +2837,6 @@ Global
28432837
{380468AD-B44D-456C-8DED-35467D11AC2F}.Release|x86.ActiveCfg = Release|Any CPU
28442838
{380468AD-B44D-456C-8DED-35467D11AC2F}.Release|x86.Build.0 = Release|Any CPU
28452839
{380468AD-B44D-456C-8DED-35467D11AC2F}.Release|x86.Deploy.0 = Release|Any CPU
2846-
{49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2847-
{49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Debug|Any CPU.Build.0 = Debug|Any CPU
2848-
{49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Debug|x64.ActiveCfg = Debug|Any CPU
2849-
{49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Debug|x64.Build.0 = Debug|Any CPU
2850-
{49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Debug|x86.ActiveCfg = Debug|Any CPU
2851-
{49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Debug|x86.Build.0 = Debug|Any CPU
2852-
{49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Release|Any CPU.ActiveCfg = Release|Any CPU
2853-
{49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Release|Any CPU.Build.0 = Release|Any CPU
2854-
{49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Release|x64.ActiveCfg = Release|Any CPU
2855-
{49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Release|x64.Build.0 = Release|Any CPU
2856-
{49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Release|x86.ActiveCfg = Release|Any CPU
2857-
{49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Release|x86.Build.0 = Release|Any CPU
2858-
{507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2859-
{507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
2860-
{507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Debug|x64.ActiveCfg = Debug|Any CPU
2861-
{507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Debug|x64.Build.0 = Debug|Any CPU
2862-
{507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Debug|x86.ActiveCfg = Debug|Any CPU
2863-
{507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Debug|x86.Build.0 = Debug|Any CPU
2864-
{507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
2865-
{507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Release|Any CPU.Build.0 = Release|Any CPU
2866-
{507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Release|x64.ActiveCfg = Release|Any CPU
2867-
{507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Release|x64.Build.0 = Release|Any CPU
2868-
{507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Release|x86.ActiveCfg = Release|Any CPU
2869-
{507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Release|x86.Build.0 = Release|Any CPU
28702840
{28D863B1-B60C-4C08-8661-EB820A5B78D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
28712841
{28D863B1-B60C-4C08-8661-EB820A5B78D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
28722842
{28D863B1-B60C-4C08-8661-EB820A5B78D2}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -4000,9 +3970,6 @@ Global
40003970
{514DED00-4DA3-46D1-B2E8-10CE826CD52D} = {081E7761-B200-4DBF-8950-941464DECACE}
40013971
{2F547104-C74A-4A84-8980-D1B973CC40C1} = {6842A2C6-5C7B-42DD-9825-0EDE91BFEBF7}
40023972
{380468AD-B44D-456C-8DED-35467D11AC2F} = {2F547104-C74A-4A84-8980-D1B973CC40C1}
4003-
{832251B9-B1A2-450A-8FB8-41F600CCA616} = {16AFCF73-8CC1-4B5D-8969-A90F468DC6D5}
4004-
{49ABFB5A-A0AF-45C1-921B-DA30CBDD121F} = {832251B9-B1A2-450A-8FB8-41F600CCA616}
4005-
{507ED409-A2FD-43BB-AC7C-778B92BD40CF} = {832251B9-B1A2-450A-8FB8-41F600CCA616}
40063973
{28D863B1-B60C-4C08-8661-EB820A5B78D2} = {F2CF5D32-4B41-425E-B229-8FFC48F88063}
40073974
{3E30D674-9282-4297-AD1F-9B233A166308} = {0651C5EF-50AA-4598-8D9C-8F210ADD8490}
40083975
{C04680A3-C92A-4631-BD1E-8E4553A3F969} = {2F547104-C74A-4A84-8980-D1B973CC40C1}

build/nuke/Build.Website.cs

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using Nuke.Common;
5+
using Serilog;
6+
using System.IO;
7+
using System;
8+
using System.Linq;
9+
using Nuke.Common.Tooling;
10+
using static Nuke.Common.IO.FileSystemTasks;
11+
using static Nuke.Common.Tools.Git.GitTasks;
12+
13+
partial class Build
14+
{
15+
[Parameter
16+
(
17+
"When enabled, pulls the latest changes for local clone of the 3.0 branch to build the website. Automatically true if the local clone doesn't exist yet."
18+
)]
19+
readonly bool PullBaseSite;
20+
21+
[Parameter("Arguments for website generation on the 3.0 branch.")]
22+
readonly string[]? SiteBuildArgs;
23+
24+
Target Website => CommonTarget
25+
(
26+
x => x.Executes
27+
(
28+
() =>
29+
{
30+
string? path;
31+
if (!File.Exists(RootDirectory / "dir.log") || !Directory.Exists(path = File.ReadAllText(RootDirectory / "dir.log")))
32+
{
33+
Log.Information("3.0 clone not found, cloning...");
34+
path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
35+
Directory.CreateDirectory(path);
36+
Git($"clone \"https://github.com/dotnet/Silk.NET\" --depth 1 --branch develop/3.0 {path}");
37+
File.WriteAllText(RootDirectory / "dir.log", path);
38+
}
39+
else if (PullBaseSite)
40+
{
41+
if (Directory.Exists($"{path}/eng/submodules/silk.net-2.x/documentation"))
42+
{
43+
Directory.Delete($"{path}/eng/submodules/silk.net-2.x/documentation", true);
44+
}
45+
46+
if (File.Exists($"{path}/eng/submodules/silk.net-2.x/documentation/version.txt"))
47+
{
48+
File.Delete($"{path}/eng/submodules/silk.net-2.x/documentation/version.txt");
49+
}
50+
51+
Git("pull", path);
52+
}
53+
else
54+
{
55+
Directory.Delete($"{path}/eng/submodules/silk.net-2.x/documentation", true);
56+
}
57+
CopyDirectoryRecursively(RootDirectory / "documentation", $"{path}/eng/submodules/silk.net-2.x/documentation");
58+
File.WriteAllText($"{path}/eng/submodules/silk.net-2.x/documentation/version.txt", Git($"describe --tags --abbrev=0").First(x => x.Type == OutputType.Std).Text.Trim());
59+
InheritedShell($"{(OperatingSystem.IsWindows() ? ".\\build.cmd" : "./build.sh")} website {string.Join(' ', (SiteBuildArgs ?? Enumerable.Empty<string>()).Select(x => $"--{x}"))}", path).AssertZeroExitCode();
60+
if (Directory.Exists(RootDirectory / "website"))
61+
{
62+
Directory.Delete(RootDirectory / "website", true);
63+
}
64+
65+
CopyDirectoryRecursively($"{path}/artifacts/docs", RootDirectory / "website");
66+
}
67+
)
68+
);
69+
}

build/nuke/Silk.NET.NUKE.csproj.DotSettings

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ANONYMOUSMETHOD_ON_SINGLE_LINE/@EntryValue">False</s:Boolean>
1717
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
1818
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
19+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=4a98fdf6_002D7d98_002D4f5a_002Dafeb_002Dea44ad98c70c/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
20+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=f9fce829_002De6f4_002D4cb2_002D80f1_002D5497c44f51df/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
1921
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue">True</s:Boolean>
2022
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
2123
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
@@ -24,4 +26,5 @@
2426
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
2527
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
2628
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
27-
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
29+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
30+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

0 commit comments

Comments
 (0)