Skip to content

Commit d9e65f8

Browse files
authored
Merge pull request #67 from microsoft/users/tevinstanley/upatelibrarytemplate
update to the latest library template
2 parents 2a0ec4e + bb75b2e commit d9e65f8

File tree

85 files changed

+551
-210
lines changed

Some content is hidden

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

85 files changed

+551
-210
lines changed

Diff for: .config/dotnet-tools.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,32 @@
33
"isRoot": true,
44
"tools": {
55
"powershell": {
6-
"version": "7.4.6",
6+
"version": "7.5.0",
77
"commands": [
88
"pwsh"
99
],
1010
"rollForward": false
1111
},
1212
"dotnet-coverage": {
13-
"version": "17.12.6",
13+
"version": "17.14.2",
1414
"commands": [
1515
"dotnet-coverage"
1616
],
1717
"rollForward": false
1818
},
1919
"nbgv": {
20-
"version": "3.6.146",
20+
"version": "3.7.115",
2121
"commands": [
2222
"nbgv"
2323
],
2424
"rollForward": false
2525
},
2626
"docfx": {
27-
"version": "2.77.0",
27+
"version": "2.78.3",
2828
"commands": [
2929
"docfx"
3030
],
3131
"rollForward": false
3232
}
3333
}
34-
}
34+
}

Diff for: .devcontainer/Dockerfile

+1-1
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.402-jammy
2+
FROM mcr.microsoft.com/dotnet/sdk:9.0.202-noble@sha256:332e0362dd210a10348d436a5fb7f87aeec28c2c53ac2c3c2659e57c22294d0e
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.

Diff for: .devcontainer/devcontainer.json

+20-15
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
{
22
"name": "Dev space",
33
"dockerFile": "Dockerfile",
4-
"settings": {
5-
"terminal.integrated.shell.linux": "/usr/bin/pwsh"
4+
"customizations": {
5+
"vscode": {
6+
"settings": {
7+
"terminal.integrated.shell.linux": "/usr/bin/pwsh"
8+
},
9+
"extensions": [
10+
"ms-azure-devops.azure-pipelines",
11+
"ms-dotnettools.csharp",
12+
"k--kato.docomment",
13+
"editorconfig.editorconfig",
14+
"esbenp.prettier-vscode",
15+
"pflannery.vscode-versionlens",
16+
"davidanson.vscode-markdownlint",
17+
"dotjoshjohnson.xml",
18+
"ms-vscode-remote.remote-containers",
19+
"ms-azuretools.vscode-docker",
20+
"tintoy.msbuild-project-tools"
21+
]
22+
}
623
},
7-
"postCreateCommand": "./init.ps1 -InstallLocality machine",
8-
"extensions": [
9-
"ms-azure-devops.azure-pipelines",
10-
"ms-dotnettools.csharp",
11-
"k--kato.docomment",
12-
"editorconfig.editorconfig",
13-
"pflannery.vscode-versionlens",
14-
"davidanson.vscode-markdownlint",
15-
"dotjoshjohnson.xml",
16-
"ms-vscode-remote.remote-containers",
17-
"ms-azuretools.vscode-docker",
18-
"ms-vscode.powershell"
19-
]
24+
"postCreateCommand": "./init.ps1 -InstallLocality machine"
2025
}

Diff for: .github/.editorconfig

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[renovate.json*]
2+
indent_style = tab

Diff for: .github/actions/publish-artifacts/action.yaml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Publish artifacts
2+
description: Publish artifacts
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: 📥 Collect artifacts
8+
run: tools/artifacts/_stage_all.ps1
9+
shell: pwsh
10+
if: always()
11+
12+
# TODO: replace this hard-coded list with a loop that utilizes the NPM package at
13+
# https://github.com/actions/toolkit/tree/main/packages/artifact (or similar) to push the artifacts.
14+
15+
- name: 📢 Upload project.assets.json files
16+
if: always()
17+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
18+
with:
19+
name: projectAssetsJson-${{ runner.os }}
20+
path: ${{ runner.temp }}/_artifacts/projectAssetsJson
21+
continue-on-error: true
22+
- name: 📢 Upload variables
23+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
24+
with:
25+
name: variables-${{ runner.os }}
26+
path: ${{ runner.temp }}/_artifacts/Variables
27+
continue-on-error: true
28+
- name: 📢 Upload build_logs
29+
if: always()
30+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
31+
with:
32+
name: build_logs-${{ runner.os }}
33+
path: ${{ runner.temp }}/_artifacts/build_logs
34+
continue-on-error: true
35+
- name: 📢 Upload testResults
36+
if: always()
37+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
38+
with:
39+
name: testResults-${{ runner.os }}
40+
path: ${{ runner.temp }}/_artifacts/testResults
41+
continue-on-error: true
42+
- name: 📢 Upload coverageResults
43+
if: always()
44+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
45+
with:
46+
name: coverageResults-${{ runner.os }}
47+
path: ${{ runner.temp }}/_artifacts/coverageResults
48+
continue-on-error: true
49+
- name: 📢 Upload symbols
50+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
51+
with:
52+
name: symbols-${{ runner.os }}
53+
path: ${{ runner.temp }}/_artifacts/symbols
54+
continue-on-error: true
55+
- name: 📢 Upload deployables
56+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
57+
with:
58+
name: deployables-${{ runner.os }}
59+
path: ${{ runner.temp }}/_artifacts/deployables
60+
if: always()

Diff for: .github/dependabot.yml

-9
This file was deleted.

Diff for: .github/renovate.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"github>microsoft/vs-renovate-presets:microbuild",
5+
"github>microsoft/vs-renovate-presets:vs_main_dependencies"
6+
],
7+
"packageRules": []
8+
}

Diff for: .github/workflows/build.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,22 @@ jobs:
3939
}
4040
shell: pwsh
4141
- name: ⚙️ Set pipeline variables based on source
42-
run: azure-pipelines/variables/_pipelines.ps1
42+
run: tools/variables/_define.ps1
4343
shell: pwsh
4444
- name: 🛠 build
4545
run: dotnet build src -t:build,pack --no-restore -c ${{ env.BUILDCONFIGURATION }} /bl:"${{ runner.temp }}/_artifacts/build_logs/build.binlog"
4646
- name: 🧪 test
47-
run: azure-pipelines/dotnet-test-cloud.ps1 -Configuration ${{ env.BUILDCONFIGURATION }} -Agent ${{ runner.os }}
47+
run: tools/dotnet-test-cloud.ps1 -Configuration ${{ env.BUILDCONFIGURATION }} -Agent ${{ runner.os }}
4848
shell: pwsh
4949
- name: 💅🏻 Verify formatted code
5050
run: dotnet format --verify-no-changes --no-restore
5151
shell: pwsh
5252
if: runner.os == 'Linux'
5353
- name: ⚙ Update pipeline variables based on build outputs
54-
run: azure-pipelines/variables/_pipelines.ps1
54+
run: tools/variables/_define.ps1
5555
shell: pwsh
5656
- name: 📥 Collect artifacts
57-
run: azure-pipelines/artifacts/_stage_all.ps1
57+
run: tools/artifacts/_stage_all.ps1
5858
shell: pwsh
5959
if: always()
6060
- name: 📢 Upload project.assets.json files

Diff for: .github/workflows/docs.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ permissions:
1010
actions: read
1111
pages: write
1212
id-token: write
13+
contents: read
1314

1415
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
1516
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
@@ -24,18 +25,20 @@ jobs:
2425
url: ${{ steps.deployment.outputs.page_url }}
2526
runs-on: ubuntu-latest
2627
steps:
27-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
29+
with:
30+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
2831
- name: ⚙ Install prerequisites
2932
run: ./init.ps1 -UpgradePrerequisites
3033

3134
- run: dotnet docfx docfx/docfx.json
3235
name: 📚 Generate documentation
3336

3437
- name: Upload artifact
35-
uses: actions/upload-pages-artifact@v3
38+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
3639
with:
3740
path: docfx/_site
3841

3942
- name: Deploy to GitHub Pages
4043
id: deployment
41-
uses: actions/deploy-pages@v4
44+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4

Diff for: .github/workflows/docs_validate.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 📃 Docfx Validate
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- main
9+
- microbuild
10+
11+
jobs:
12+
build:
13+
name: 📚 Doc validation
14+
runs-on: ubuntu-24.04
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
19+
- name: 🔗 Markup Link Checker (mlc)
20+
uses: becheran/mlc@v0.21.0
21+
with:
22+
args: --do-not-warn-for-redirect-to https://learn.microsoft.com*,https://dotnet.microsoft.com/*,https://dev.azure.com/*,https://app.codecov.io/* -p docfx -i https://aka.ms/onboardsupport,https://aka.ms/spot,https://msrc.microsoft.com/*,https://www.microsoft.com/msrc*,https://microsoft.com/msrc*
23+
- name: ⚙ Install prerequisites
24+
run: |
25+
./init.ps1 -UpgradePrerequisites
26+
dotnet --info
27+
shell: pwsh
28+
- name: 📚 Verify docfx build
29+
run: dotnet docfx docfx/docfx.json --warningsAsErrors --disableGitFeatures
30+
if: runner.os == 'Linux'

Diff for: .github/workflows/libtemplate-update.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Library.Template update
1+
name: Library.Template update
22

33
# PREREQUISITE: This workflow requires the repo to be configured to allow workflows to create pull requests.
44
# Visit https://github.com/USER/REPO/settings/actions
@@ -17,15 +17,15 @@ jobs:
1717
contents: write
1818
pull-requests: write
1919
steps:
20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2121
with:
2222
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
2323

2424
- name: merge
2525
id: merge
2626
shell: pwsh
2727
run: |
28-
$LibTemplateBranch = & ./azure-pipelines/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated
28+
$LibTemplateBranch = & ./tools/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated
2929
if ($LASTEXITCODE -ne 0) {
3030
exit $LASTEXITCODE
3131
}
@@ -45,7 +45,7 @@ jobs:
4545
4646
# Pushing commits that add or change files under .github/workflows will cause our workflow to fail.
4747
# 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
48+
# So if the merge doesn't bring in any changes to these files, try the merge locally and push that
4949
# to keep github happy.
5050
if ((git rev-list FETCH_HEAD ^HEAD --count -- .github/workflows) -eq 0) {
5151
# Indeed there are no changes in that area. So merge locally to try to appease GitHub.
@@ -77,7 +77,7 @@ jobs:
7777
$prTitle = "Merge latest Library.Template"
7878
$prBody = "This merges the latest features and fixes from [Library.Template's branch](https://github.com/AArnott/Library.Template/tree/).
7979
80-
⚠️ Do **not** squash this pull request when completing it. You must *merge* it."
80+
⚠️ Do **not** squash this pull request when completing it. You must *merge* it.
8181
8282
<details>
8383
<summary>Merge conflicts?</summary>
@@ -91,7 +91,7 @@ jobs:
9191
git commit
9292
git push
9393
```
94-
</details>
94+
</details>"
9595
9696
gh pr create -H auto/libtemplateUpdate -b $prBody -t $prTitle
9797
env:

Diff for: CONTRIBUTING.md

+70-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,73 @@ https://cla.microsoft.com.
1111

1212
## Pull requests
1313

14-
When you submit a pull request, a CLA-bot will automatically determine whether you need
15-
to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the
16-
instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
14+
## Prerequisites
15+
16+
All dependencies can be installed by running the `init.ps1` script at the root of the repository
17+
using Windows PowerShell or [PowerShell Core][pwsh] (on any OS).
18+
Some dependencies installed by `init.ps1` may only be discoverable from the same command line environment the init script was run from due to environment variables, so be sure to launch Visual Studio or build the repo from that same environment.
19+
Alternatively, run `init.ps1 -InstallLocality Machine` (which may require elevation) in order to install dependencies at machine-wide locations so Visual Studio and builds work everywhere.
20+
21+
The only prerequisite for building, testing, and deploying from this repository
22+
is the [.NET SDK](https://get.dot.net/).
23+
You should install the version specified in `global.json` or a later version within
24+
the same major.minor.Bxx "hundreds" band.
25+
For example if 2.2.300 is specified, you may install 2.2.300, 2.2.301, or 2.2.310
26+
while the 2.2.400 version would not be considered compatible by .NET SDK.
27+
See [.NET Core Versioning](https://learn.microsoft.com/dotnet/core/versions/) for more information.
28+
29+
## Package restore
30+
31+
The easiest way to restore packages may be to run `init.ps1` which automatically authenticates
32+
to the feeds that packages for this repo come from, if any.
33+
`dotnet restore` or `nuget restore` also work but may require extra steps to authenticate to any applicable feeds.
34+
35+
## Building
36+
37+
This repository can be built on Windows, Linux, and OSX.
38+
39+
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.).
40+
41+
[pwsh]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell?view=powershell-6
42+
43+
## Releases
44+
45+
Use `nbgv tag` to create a tag for a particular commit that you mean to release.
46+
[Learn more about `nbgv` and its `tag` and `prepare-release` commands](https://dotnet.github.io/Nerdbank.GitVersioning/docs/nbgv-cli.html).
47+
48+
Push the tag.
49+
50+
### GitHub Actions
51+
52+
When your repo is hosted by GitHub and you are using GitHub Actions, you should create a GitHub Release using the standard GitHub UI.
53+
Having previously used `nbgv tag` and pushing the tag will help you identify the precise commit and name to use for this release.
54+
55+
After publishing the release, the `.github\workflows\release.yml` workflow will be automatically triggered, which will:
56+
57+
1. Find the most recent `.github\workflows\build.yml` GitHub workflow run of the tagged release.
58+
1. Upload the `deployables` artifact from that workflow run to your GitHub Release.
59+
1. If you have `NUGET_API_KEY` defined as a secret variable for your repo or org, any nuget packages in the `deployables` artifact will be pushed to nuget.org.
60+
61+
### Azure Pipelines
62+
63+
When your repo builds with Azure Pipelines, use the `azure-pipelines/release.yml` pipeline.
64+
Trigger the pipeline by adding the `auto-release` tag on a run of your main `azure-pipelines.yml` pipeline.
65+
66+
## Tutorial and API documentation
67+
68+
API and hand-written docs are found under the `docfx/` directory. and are built by [docfx](https://dotnet.github.io/docfx/).
69+
70+
You can make changes and host the site locally to preview them by switching to that directory and running the `dotnet docfx --serve` command.
71+
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.
72+
73+
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).
74+
75+
## Updating dependencies
76+
77+
This repo uses Renovate to keep dependencies current.
78+
Configuration is in the `.github/renovate.json` file.
79+
[Learn more about configuring Renovate](https://docs.renovatebot.com/configuration-options/).
80+
81+
When changing the renovate.json file, follow [these validation steps](https://docs.renovatebot.com/config-validation/).
82+
83+
If Renovate is not creating pull requests when you expect it to, check that the [Renovate GitHub App](https://github.com/apps/renovate) is configured for your account or repo.

0 commit comments

Comments
 (0)