Skip to content

Commit 8bdf3ba

Browse files
authored
Merge pull request #46 from AArnott/libtemplateUpdate
Merge latest Library.Template
2 parents d10db23 + caa7f5b commit 8bdf3ba

38 files changed

+545
-43
lines changed

.config/dotnet-tools.json

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,32 @@
33
"isRoot": true,
44
"tools": {
55
"powershell": {
6-
"version": "7.4.5",
6+
"version": "7.4.6",
77
"commands": [
88
"pwsh"
9-
]
9+
],
10+
"rollForward": false
1011
},
1112
"dotnet-coverage": {
12-
"version": "17.12.5",
13+
"version": "17.12.6",
1314
"commands": [
1415
"dotnet-coverage"
15-
]
16+
],
17+
"rollForward": false
1618
},
1719
"nbgv": {
18-
"version": "3.6.143",
20+
"version": "3.6.146",
1921
"commands": [
2022
"nbgv"
21-
]
23+
],
24+
"rollForward": false
25+
},
26+
"docfx": {
27+
"version": "2.78.1",
28+
"commands": [
29+
"docfx"
30+
],
31+
"rollForward": false
2232
}
2333
}
2434
}

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Refer to https://hub.docker.com/_/microsoft-dotnet-sdk for available versions
2-
FROM mcr.microsoft.com/dotnet/sdk:8.0.400-jammy
2+
FROM mcr.microsoft.com/dotnet/sdk:9.0.100-noble
33

44
# Installing mono makes `dotnet test` work without errors even for net472.
55
# But installing it takes a long time, so it's excluded by default.

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
"ms-dotnettools.csharp",
1111
"k--kato.docomment",
1212
"editorconfig.editorconfig",
13+
"esbenp.prettier-vscode",
1314
"pflannery.vscode-versionlens",
1415
"davidanson.vscode-markdownlint",
1516
"dotjoshjohnson.xml",
1617
"ms-vscode-remote.remote-containers",
1718
"ms-azuretools.vscode-docker",
18-
"ms-vscode.powershell"
19+
"tintoy.msbuild-project-tools"
1920
]
2021
}

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ updates:
99
interval: weekly
1010
ignore:
1111
- dependency-name: xunit.extensibility.execution
12+
- package-ecosystem: dotnet-sdk
13+
directory: /
14+
schedule:
15+
interval: monthly

.github/workflows/docs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: 📚 Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9+
permissions:
10+
actions: read
11+
pages: write
12+
id-token: write
13+
14+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
15+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: false
19+
20+
jobs:
21+
publish-docs:
22+
environment:
23+
name: github-pages
24+
url: ${{ steps.deployment.outputs.page_url }}
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: ⚙ Install prerequisites
29+
run: ./init.ps1 -UpgradePrerequisites
30+
31+
- run: dotnet docfx docfx/docfx.json
32+
name: 📚 Generate documentation
33+
34+
- name: Upload artifact
35+
uses: actions/upload-pages-artifact@v3
36+
with:
37+
path: docfx/_site
38+
39+
- name: Deploy to GitHub Pages
40+
id: deployment
41+
uses: actions/deploy-pages@v4
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Library.Template update
2+
3+
# PREREQUISITE: This workflow requires the repo to be configured to allow workflows to create pull requests.
4+
# Visit https://github.com/USER/REPO/settings/actions
5+
# Under "Workflow permissions" check "Allow GitHub Actions to create ...pull requests"
6+
# Click Save.
7+
8+
on:
9+
schedule:
10+
- cron: "0 3 * * Mon" # Sun @ 8 or 9 PM Mountain Time (depending on DST)
11+
workflow_dispatch:
12+
13+
jobs:
14+
merge:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
pull-requests: write
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
23+
24+
- name: merge
25+
id: merge
26+
shell: pwsh
27+
run: |
28+
$LibTemplateBranch = & ./azure-pipelines/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated
29+
if ($LASTEXITCODE -ne 0) {
30+
exit $LASTEXITCODE
31+
}
32+
33+
git fetch https://github.com/aarnott/Library.Template $LibTemplateBranch
34+
if ($LASTEXITCODE -ne 0) {
35+
exit $LASTEXITCODE
36+
}
37+
$LibTemplateCommit = git rev-parse FETCH_HEAD
38+
git diff --stat ...FETCH_HEAD
39+
40+
if ((git rev-list FETCH_HEAD ^HEAD --count) -eq 0) {
41+
Write-Host "There are no Library.Template updates to merge."
42+
echo "uptodate=true" >> $env:GITHUB_OUTPUT
43+
exit 0
44+
}
45+
46+
# Pushing commits that add or change files under .github/workflows will cause our workflow to fail.
47+
# But it usually isn't necessary because the target branch already has (or doesn't have) these changes.
48+
# So if the merged doesn't bring in any changes to these files, try the merge locally and push that
49+
# to keep github happy.
50+
if ((git rev-list FETCH_HEAD ^HEAD --count -- .github/workflows) -eq 0) {
51+
# Indeed there are no changes in that area. So merge locally to try to appease GitHub.
52+
git checkout -b auto/libtemplateUpdate
53+
git config user.name "Andrew Arnott"
54+
git config user.email "[email protected]"
55+
git merge FETCH_HEAD
56+
if ($LASTEXITCODE -ne 0) {
57+
Write-Host "Merge conflicts prevent creating the pull request. Please run tools/MergeFrom-Template.ps1 locally and push the result as a pull request."
58+
exit 2
59+
}
60+
61+
git -c http.extraheader="AUTHORIZATION: bearer $env:GH_TOKEN" push origin -u HEAD
62+
} else {
63+
Write-Host "Changes to github workflows are included in this update. Please run tools/MergeFrom-Template.ps1 locally and push the result as a pull request."
64+
exit 1
65+
}
66+
- name: pull request
67+
shell: pwsh
68+
if: success() && steps.merge.outputs.uptodate != 'true'
69+
run: |
70+
# If there is already an active pull request, don't create a new one.
71+
$existingPR = gh pr list -H auto/libtemplateUpdate --json url | ConvertFrom-Json
72+
if ($existingPR) {
73+
Write-Host "::warning::Skipping pull request creation because one already exists at $($existingPR[0].url)"
74+
exit 0
75+
}
76+
77+
$prTitle = "Merge latest Library.Template"
78+
$prBody = "This merges the latest features and fixes from [Library.Template's branch](https://github.com/AArnott/Library.Template/tree/).
79+
80+
⚠️ Do **not** squash this pull request when completing it. You must *merge* it.
81+
82+
<details>
83+
<summary>Merge conflicts?</summary>
84+
Resolve merge conflicts locally by carrying out these steps:
85+
86+
```
87+
git fetch
88+
git checkout auto/libtemplateUpdate
89+
git merge origin/main
90+
# resolve conflicts
91+
git commit
92+
git push
93+
```
94+
</details>"
95+
96+
gh pr create -H auto/libtemplateUpdate -b $prBody -t $prTitle
97+
env:
98+
GH_TOKEN: ${{ github.token }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ bld/
3737
# Uncomment if you have tasks that create the project's static files in wwwroot
3838
#wwwroot/
3939

40+
# Jetbrains Rider cache directory
41+
.idea/
42+
4043
# Visual Studio 2017 auto generated files
4144
Generated\ Files/
4245

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,12 @@ This repository can be built on Windows, Linux, and OSX.
4040
Building, testing, and packing this repository can be done by using the standard dotnet CLI commands (e.g. `dotnet build`, `dotnet test`, `dotnet pack`, etc.).
4141

4242
[pwsh]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell?view=powershell-6
43+
44+
## Tutorial and API documentation
45+
46+
API and hand-written docs are found under the `docfx/` directory. and are built by [docfx](https://dotnet.github.io/docfx/).
47+
48+
You can make changes and host the site locally to preview them by switching to that directory and running the `dotnet docfx --serve` command.
49+
After making a change, you can rebuild the docs site while the localhost server is running by running `dotnet docfx` again from a separate terminal.
50+
51+
The `.github/workflows/docs.yml` GitHub Actions workflow publishes the content of these docs to github.io if the workflow itself and [GitHub Pages is enabled for your repository](https://docs.github.com/en/pages/quickstart).

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
<Target Name="PrepareReleaseNotes" BeforeTargets="GenerateNuspec" DependsOnTargets="GetBuildVersion">
5252
<PropertyGroup>
53-
<PackageReleaseNotes Condition="'$(PackageProjectUrl)'!=''">$(PackageProjectUrl)/releases/tag/v$(Version)</PackageReleaseNotes>
53+
<PackageReleaseNotes Condition="'$(RepositoryUrl)'!=''">$(RepositoryUrl)/releases/tag/v$(Version)</PackageReleaseNotes>
5454
</PropertyGroup>
5555
</Target>
5656
</Project>

Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<PropertyGroup>
4-
<LangVersion Condition="'$(Language)'=='C#'">12</LangVersion>
4+
<LangVersion Condition="'$(Language)'=='C#'">13</LangVersion>
55
<LangVersion Condition="'$(Language)'=='VB'">16.9</LangVersion>
66
</PropertyGroup>
77
<ItemGroup>

0 commit comments

Comments
 (0)