Skip to content

Commit 7cbde53

Browse files
committed
Add a website 3.0 workflow
1 parent 7e5ed1f commit 7cbde53

File tree

3 files changed

+41
-9
lines changed

3 files changed

+41
-9
lines changed

.github/workflows/publish-site.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Website Build
2+
on:
3+
push:
4+
branches:
5+
- 'feature/website-3.0'
6+
pull_request:
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
jobs:
13+
Build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Build Website
18+
run: |
19+
git submodule update --init --recommend-shallow eng/submodules/silk.net-2.x
20+
./build.sh website
21+
- name: Upload artifact
22+
if: ${{ github.repository == 'dotnet/Silk.NET' && github.ref == 'refs/heads/develop/3.0' }}
23+
uses: actions/upload-pages-artifact@v1
24+
with:
25+
path: "artifacts/docs/Silk.NET"
26+
Deploy:
27+
if: ${{ github.repository == 'dotnet/Silk.NET' && github.ref == 'refs/heads/develop/3.0' }}
28+
environment:
29+
name: github-pages
30+
url: ${{ steps.deployment.outputs.page_url }}
31+
runs-on: ubuntu-latest
32+
needs: Build
33+
steps:
34+
- name: Deploy to GitHub Pages
35+
id: deployment
36+
uses: actions/deploy-pages@v1

eng/build/Build.Website.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ readonly record struct VersionDescription(
2727
AbsolutePath? Changelog = null
2828
);
2929

30-
// From oldest to newest. Last one is current.
31-
const bool IsCurrentVersionPreview = true;
32-
3330
[Parameter("If enabled, skips scraping the contributors for the authors.yml file of the blog.")]
3431
readonly bool SkipContributorsScrape;
3532

@@ -107,13 +104,12 @@ await GetAuthorsContents().ToListAsync()
107104
}
108105

109106
jsonVersions[i == versions.Length - 1 ? "current" : version.Name] = new JsonVersion(
110-
version.Changelog is { } changelog
111-
? GetVersionFromChangelog(changelog)
107+
version.Changelog is { } changelog ? GetVersionFromChangelog(changelog)
112108
: File.Exists(version.Path / "version.txt")
113109
? File.ReadAllText(version.Path / "version.txt")
114-
: Git($"describe --tags --abbrev=0", version.Path)
115-
.First(x => x.Type == OutputType.Std)
116-
.Text.Trim(),
110+
: Git($"describe --tags --abbrev=0", version.Path)
111+
.First(x => x.Type == OutputType.Std)
112+
.Text.Trim(),
117113
i == versions.Length - 1 ? version.Name : null
118114
);
119115
}

eng/submodules/silk.net-2.x

Submodule silk.net-2.x updated 32 files

0 commit comments

Comments
 (0)