Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
66fe1ca
Add markup link checker to GitHub workflow
AArnott Jan 27, 2025
b3b3da2
Fix stale link in CONTRIBUTING.md
AArnott Jan 27, 2025
e562b36
Merge pull request #342 from AArnott/mlc
AArnott Jan 27, 2025
9409f44
Bump nuget.exe build tool to 6.12.2
AArnott Jan 27, 2025
e25313b
Update becheran/mlc action to v0.19.1
renovate[bot] Feb 4, 2025
83228fe
Suppress an expected doc warning
AArnott Feb 4, 2025
015fcf6
Merge pull request #344 from AArnott/renovate/becheran-mlc-0.x
AArnott Feb 4, 2025
3856c54
Update becheran/mlc action to v0.19.2 (#345)
renovate[bot] Feb 4, 2025
8eb0937
Renovate should not update to versions from non-release branches
AArnott Feb 6, 2025
9db1062
Drop group name in renovate
AArnott Feb 6, 2025
574886f
Update xunit (#346)
renovate[bot] Feb 7, 2025
a71c97c
Update becheran/mlc action to v0.21.0 (#347)
renovate[bot] Feb 10, 2025
a8d08d4
Update dependency Microsoft.NET.Test.Sdk to 17.13.0 (#348)
renovate[bot] Feb 10, 2025
5724fef
Update Dockerfile and global.json updates to v9.0.200
renovate[bot] Feb 12, 2025
c24a8f0
Update dependency dotnet-coverage to 17.14.1
renovate[bot] Feb 19, 2025
0527720
Update dependency docfx to 2.78.3 (#351)
renovate[bot] Feb 20, 2025
0fb1dde
Update dependency dotnet-coverage to 17.14.2 (#352)
renovate[bot] Feb 27, 2025
161bac9
Fix GitHub release workflow in dispatched runs
AArnott Mar 3, 2025
1e00ddc
Drop semanticCommits setting from renovate.json
AArnott Mar 4, 2025
46e768b
Revert "Avoid `dotnet format` hang"
AArnott Mar 10, 2025
e5d6527
Merge pull request #355 from AArnott/renovate/dockerfile-and-global.j…
renovate[bot] Mar 12, 2025
24a6e2b
Build renovate settings on the best-practices preset (#357)
AArnott Mar 19, 2025
408618f
Update Dockerfile and global.json updates to v9.0.202 (#356)
renovate[bot] Mar 19, 2025
b8573cf
Pin dependencies (#358)
renovate[bot] Mar 19, 2025
4569224
Pin mcr.microsoft.com/dotnet/sdk Docker tag to 332e036 (#359)
renovate[bot] Mar 19, 2025
32fa187
Update mcr.microsoft.com/dotnet/sdk:9.0.202-noble Docker digest to dc…
renovate[bot] Mar 24, 2025
268a3af
Update dependency xunit.v3 to v2 (#353)
renovate[bot] Apr 6, 2025
d4ce11e
Update Dockerfile and global.json updates to v9.0.203 (#364)
renovate[bot] Apr 9, 2025
2fb29d7
Update docs to use MergeFrom-Template.ps1
AArnott Apr 16, 2025
23cd85a
Fix lang service reporting C# 7.3 errors in Error List
AArnott Apr 22, 2025
1a8cb76
Update actions/download-artifact digest to d3f86a1
renovate[bot] Apr 28, 2025
8dc9804
Update dependency powershell to 7.5.1
renovate[bot] Apr 28, 2025
1ddad47
Update mcr.microsoft.com/dotnet/sdk:9.0.203-noble Docker digest to c8…
renovate[bot] Apr 28, 2025
508b839
Update xunit (#370)
renovate[bot] May 4, 2025
8fe4f14
Add support for a repo to hard-code extra SDKs that must be installed
AArnott May 6, 2025
0e0b8be
Merge pull request #371 from AArnott/multipleSDKs
AArnott May 6, 2025
3b421ec
Add script for collecting 3rd party symbol files
AArnott May 7, 2025
5cc3d59
Reapply "Avoid `dotnet format` hang"
AArnott Apr 24, 2025
e84bdc6
Fix 3rd party symbol archival
AArnott May 9, 2025
56aaaf0
Update Dockerfile and global.json updates to v9.0.300 (#372)
renovate[bot] May 14, 2025
94431e7
Update dependency Microsoft.NET.Test.Sdk to 17.14.0
AArnott May 20, 2025
08b8fab
Update mcr.microsoft.com/dotnet/sdk:9.0.300-noble Docker digest to 9f…
renovate[bot] May 29, 2025
25a0aa4
Update becheran/mlc action to v0.22.0 (#374)
renovate[bot] May 29, 2025
7974fd3
Update dependency Microsoft.NET.Test.Sdk to 17.14.1
AArnott Jun 3, 2025
df32f51
Update xunit
renovate[bot] Jun 7, 2025
0c41b21
Update Dockerfile and global.json updates to v9.0.301 (#376)
renovate[bot] Jun 11, 2025
4e511af
Add copilot swe agent setup instructions (#377)
AArnott Jun 11, 2025
e332f1e
Merge the main branch from https://github.com/aarnott/Library.Template
AArnott Jun 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"isRoot": true,
"tools": {
"powershell": {
"version": "7.5.0",
"version": "7.5.1",
"commands": [
"pwsh"
],
"rollForward": false
},
"dotnet-coverage": {
"version": "17.13.1",
"version": "17.14.2",
"commands": [
"dotnet-coverage"
],
Expand All @@ -24,7 +24,7 @@
"rollForward": false
},
"docfx": {
"version": "2.78.2",
"version": "2.78.3",
"commands": [
"docfx"
],
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Refer to https://hub.docker.com/_/microsoft-dotnet-sdk for available versions
FROM mcr.microsoft.com/dotnet/sdk:9.0.102-noble
FROM mcr.microsoft.com/dotnet/sdk:9.0.301-noble@sha256:4f50505b5344e9d8a76805d71bb4ba76da6b01656e17a66a8ce1e4c4dfaaec12

# Installing mono makes `dotnet test` work without errors even for net472.
# But installing it takes a long time, so it's excluded by default.
Expand Down
14 changes: 7 additions & 7 deletions .github/actions/publish-artifacts/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,46 @@ runs:

- name: 📢 Upload project.assets.json files
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: projectAssetsJson-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/projectAssetsJson
continue-on-error: true
- name: 📢 Upload variables
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: variables-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/Variables
continue-on-error: true
- name: 📢 Upload build_logs
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: build_logs-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/build_logs
continue-on-error: true
- name: 📢 Upload testResults
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: testResults-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/testResults
continue-on-error: true
- name: 📢 Upload coverageResults
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: coverageResults-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/coverageResults
continue-on-error: true
- name: 📢 Upload symbols
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: symbols-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/symbols
continue-on-error: true
- name: 📢 Upload deployables
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: deployables-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/deployables
Expand Down
7 changes: 5 additions & 2 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"semanticCommits": "disabled",
"extends": ["config:best-practices"],
"labels": ["dependencies"],
"packageRules": [
{
Expand All @@ -21,6 +20,10 @@
"matchDatasources": ["dotnet-version", "docker"],
"matchDepNames": ["dotnet-sdk", "mcr.microsoft.com/dotnet/sdk"],
"groupName": "Dockerfile and global.json updates"
},
{
"matchPackageNames": ["*"],
"allowedVersions": "!/-g[a-f0-9]+$/"
}
]
}
12 changes: 11 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- windows-2022

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: ⚙ Install prerequisites
Expand Down Expand Up @@ -72,6 +72,16 @@ jobs:
continue-on-error: true
if: env.codecov_token != ''

docs:
name: 📃 Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: 🔗 Markup Link Checker (mlc)
uses: becheran/mlc@88c9db09b8dabab813a2edd13f955b36aa73657a # v0.22.0
with:
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

ship:
if: startsWith(github.ref, 'refs/tags/v')
needs: build
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "Copilot Setup Steps"

# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
branches:
- main
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml

jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-latest
# Set the permissions to the lowest permissions possible needed for your steps.
# Copilot will be given its own token for its operations.
permissions:
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
contents: read

# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: ⚙ Install prerequisites
run: |
./init.ps1 -UpgradePrerequisites -NoNuGetCredProvider
dotnet --info

# Print mono version if it is present.
if (Get-Command mono -ErrorAction SilentlyContinue) {
mono --version
}
shell: pwsh
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: ⚙ Install prerequisites
Expand All @@ -35,10 +35,10 @@ jobs:
name: 📚 Generate documentation

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
with:
path: docfx/_site

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
2 changes: 1 addition & 1 deletion .github/workflows/libtemplate-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
Echo "runid=$runid" >> $env:GITHUB_OUTPUT

- name: 🔻 Download deployables artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: deployables-Linux
path: ${{ runner.temp }}/deployables
Expand All @@ -74,11 +74,11 @@ jobs:

- name: 💽 Upload artifacts to release
shell: pwsh
if: ${{ github.event.release.assets_url }} != ''
if: ${{ github.event_name == 'release' && github.event.release.assets_url != '' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
Get-ChildItem '${{ runner.temp }}/deployables' |% {
Get-ChildItem '${{ runner.temp }}/deployables' -File -Recurse |% {
Write-Host "Uploading $($_.Name) to release..."
gh release -R ${{ github.repository }} upload "${{ github.ref_name }}" $_.FullName
}
Expand Down
18 changes: 16 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ You should install the version specified in `global.json` or a later version wit
the same major.minor.Bxx "hundreds" band.
For example if 2.2.300 is specified, you may install 2.2.300, 2.2.301, or 2.2.310
while the 2.2.400 version would not be considered compatible by .NET SDK.
See [.NET Core Versioning](https://docs.microsoft.com/dotnet/core/versions/) for more information.
See [.NET Core Versioning](https://learn.microsoft.com/dotnet/core/versions/) for more information.

## Package restore

Expand All @@ -44,7 +44,7 @@ Building, testing, and packing this repository can be done by using the standard
## Releases

Use `nbgv tag` to create a tag for a particular commit that you mean to release.
[Learn more about `nbgv` and its `tag` and `prepare-release` commands](https://github.com/dotnet/Nerdbank.GitVersioning/blob/main/doc/nbgv-cli.md).
[Learn more about `nbgv` and its `tag` and `prepare-release` commands](https://dotnet.github.io/Nerdbank.GitVersioning/docs/nbgv-cli.html).

Push the tag.

Expand Down Expand Up @@ -82,3 +82,17 @@ Configuration is in the `.github/renovate.json` file.
When changing the renovate.json file, follow [these validation steps](https://docs.renovatebot.com/config-validation/).

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.

## Merging latest from Library.Template

### Maintaining your repo based on this template

The best way to keep your repo in sync with Library.Template's evolving features and best practices is to periodically merge the template into your repo:
`
```ps1
git fetch
git checkout origin/main
.\tools\MergeFrom-Template.ps1
# resolve any conflicts, then commit the merge commit.
git push origin -u HEAD
```
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<PropertyGroup>
<LangVersion Condition="'$(MSBuildProjectExtension)'=='.csproj'">13</LangVersion>
<LangVersion Condition="'$(MSBuildProjectExtension)'=='.vbproj'">16.9</LangVersion>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" />
</ItemGroup>
Expand Down
4 changes: 0 additions & 4 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<LangVersion Condition="'$(Language)'=='C#'">13</LangVersion>
<LangVersion Condition="'$(Language)'=='VB'">16.9</LangVersion>
</PropertyGroup>
<ItemGroup>
<!-- Avoid compile error about missing namespace when combining ImplicitUsings with .NET Framework target frameworks. -->
<Using Remove="System.Net.Http" Condition="'$(TargetFrameworkIdentifier)'=='.NETFramework'" />
Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageVersion Include="Validation" Version="2.6.68" />
</ItemGroup>
<ItemGroup Label="Library.Template">
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="xunit" Version="2.9.3" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "9.0.102",
"version": "9.0.301",
"rollForward": "patch",
"allowPrerelease": false
}
Expand Down
91 changes: 91 additions & 0 deletions tools/Get-3rdPartySymbolFiles.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
Function Get-FileFromWeb([Uri]$Uri, $OutFile) {
$OutDir = Split-Path $OutFile
if (!(Test-Path $OutFile)) {
Write-Verbose "Downloading $Uri..."
if (!(Test-Path $OutDir)) { New-Item -ItemType Directory -Path $OutDir | Out-Null }
try {
(New-Object System.Net.WebClient).DownloadFile($Uri, $OutFile)
}
finally {
# This try/finally causes the script to abort
}
}
}

Function Unzip($Path, $OutDir) {
$OutDir = (New-Item -ItemType Directory -Path $OutDir -Force).FullName
Add-Type -AssemblyName System.IO.Compression.FileSystem

# Start by extracting to a temporary directory so that there are no file conflicts.
[System.IO.Compression.ZipFile]::ExtractToDirectory($Path, "$OutDir.out")

# Now move all files from the temp directory to $OutDir, overwriting any files.
Get-ChildItem -Path "$OutDir.out" -Recurse -File | ForEach-Object {
$destinationPath = Join-Path -Path $OutDir -ChildPath $_.FullName.Substring("$OutDir.out".Length).TrimStart([io.path]::DirectorySeparatorChar, [io.path]::AltDirectorySeparatorChar)
if (!(Test-Path -Path (Split-Path -Path $destinationPath -Parent))) {
New-Item -ItemType Directory -Path (Split-Path -Path $destinationPath -Parent) | Out-Null
}
Move-Item -Path $_.FullName -Destination $destinationPath -Force
}
Remove-Item -Path "$OutDir.out" -Recurse -Force
}

Function Get-SymbolsFromPackage($id, $version) {
$symbolPackagesPath = "$PSScriptRoot/../obj/SymbolsPackages"
New-Item -ItemType Directory -Path $symbolPackagesPath -Force | Out-Null
$nupkgPath = Join-Path $symbolPackagesPath "$id.$version.nupkg"
$snupkgPath = Join-Path $symbolPackagesPath "$id.$version.snupkg"
$unzippedPkgPath = Join-Path $symbolPackagesPath "$id.$version"
Get-FileFromWeb -Uri "https://www.nuget.org/api/v2/package/$id/$version" -OutFile $nupkgPath
Get-FileFromWeb -Uri "https://www.nuget.org/api/v2/symbolpackage/$id/$version" -OutFile $snupkgPath

Unzip -Path $nupkgPath -OutDir $unzippedPkgPath
Unzip -Path $snupkgPath -OutDir $unzippedPkgPath

Get-ChildItem -Recurse -LiteralPath $unzippedPkgPath -Filter *.pdb | % {
# Collect the DLLs/EXEs as well.
$rootName = Join-Path $_.Directory $_.BaseName
if ($rootName.EndsWith('.ni')) {
$rootName = $rootName.Substring(0, $rootName.Length - 3)
}

$dllPath = "$rootName.dll"
$exePath = "$rootName.exe"
if (Test-Path $dllPath) {
$BinaryImagePath = $dllPath
}
elseif (Test-Path $exePath) {
$BinaryImagePath = $exePath
}
else {
Write-Warning "`"$_`" found with no matching binary file."
$BinaryImagePath = $null
}

if ($BinaryImagePath) {
Write-Output $BinaryImagePath
Write-Output $_.FullName
}
}
}

Function Get-PackageVersion($id) {
$versionProps = [xml](Get-Content -LiteralPath $PSScriptRoot\..\Directory.Packages.props)
$version = $versionProps.Project.ItemGroup.PackageVersion | ? { $_.Include -eq $id } | % { $_.Version }
if (!$version) {
Write-Error "No package version found in Directory.Packages.props for the package '$id'"
}

$version
}

# All 3rd party packages for which symbols packages are expected should be listed here.
# These must all be sourced from nuget.org, as it is the only feed that supports symbol packages.
$3rdPartyPackageIds = @()

$3rdPartyPackageIds | % {
$version = Get-PackageVersion $_
if ($version) {
Get-SymbolsFromPackage -id $_ -version $version
}
}
Loading
Loading