Skip to content

Commit 64247ea

Browse files
authored
Merge pull request #73 from microsoft/dev/tevinstanley/libtemplateUpdate
Dev/tevinstanley/libtemplate update
2 parents 7c5b2c7 + 884cc16 commit 64247ea

40 files changed

+403
-161
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"powershell": {
6-
"version": "7.5.0",
6+
"version": "7.5.3",
77
"commands": [
88
"pwsh"
99
],

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

.github/copilot-instructions.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copilot instructions for this repository
2+
3+
## High level guidance
4+
5+
* Review the `CONTRIBUTING.md` file for instructions to build and test the software.
6+
* Set the `NBGV_GitEngine` environment variable to `Disabled` before running any `dotnet` or `msbuild` commands.
7+
8+
## Software Design
9+
10+
* Design APIs to be highly testable, and all functionality should be tested.
11+
* Avoid introducing binary breaking changes in public APIs of projects under `src` unless their project files have `IsPackable` set to `false`.
12+
13+
## Testing
14+
15+
* There should generally be one test project (under the `test` directory) per shipping project (under the `src` directory). Test projects are named after the project being tested with a `.Test` suffix.
16+
* Tests should use the Xunit testing framework.
17+
* Some tests are known to be unstable. When running tests, you should skip the unstable ones by running `dotnet test --filter "TestCategory!=FailsInCloudTest"`.
18+
19+
## Coding style
20+
21+
* Honor StyleCop rules and fix any reported build warnings *after* getting tests to pass.
22+
* In C# files, use namespace *statements* instead of namespace *blocks* for all new files.
23+
* Add API doc comments to all new public and internal members.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: 💪🏼 Copilot Setup Steps
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- .github/workflows/copilot-setup-steps.yml
12+
pull_request:
13+
paths:
14+
- .github/workflows/copilot-setup-steps.yml
15+
16+
jobs:
17+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
18+
copilot-setup-steps:
19+
runs-on: ubuntu-latest
20+
# Set the permissions to the lowest permissions possible needed for your steps.
21+
# Copilot will be given its own token for its operations.
22+
permissions:
23+
# 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.
24+
contents: read
25+
26+
# You can define any steps you want, and they will run before the agent starts.
27+
# If you do not check out your code, Copilot will do this for you.
28+
steps:
29+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
30+
with:
31+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
32+
- name: ⚙ Install prerequisites
33+
run: |
34+
./init.ps1 -UpgradePrerequisites -NoNuGetCredProvider
35+
dotnet --info
36+
37+
# Print mono version if it is present.
38+
if (Get-Command mono -ErrorAction SilentlyContinue) {
39+
mono --version
40+
}
41+
shell: pwsh

.github/workflows/docs.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ on:
55
branches:
66
- main
77

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-
contents: read
14-
158
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
169
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
1710
concurrency:
@@ -20,12 +13,18 @@ concurrency:
2013

2114
jobs:
2215
publish-docs:
16+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
17+
permissions:
18+
actions: read
19+
pages: write
20+
id-token: write
21+
contents: read
2322
environment:
2423
name: github-pages
2524
url: ${{ steps.deployment.outputs.page_url }}
2625
runs-on: ubuntu-latest
2726
steps:
28-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
27+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2928
with:
3029
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
3130
- name: ⚙ Install prerequisites
@@ -35,7 +34,7 @@ jobs:
3534
name: 📚 Generate documentation
3635

3736
- name: Upload artifact
38-
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
37+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
3938
with:
4039
path: docfx/_site
4140

.github/workflows/docs_validate.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
name: 📚 Doc validation
1313
runs-on: ubuntu-24.04
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
1616
with:
1717
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
1818
- name: 🔗 Markup Link Checker (mlc)
19-
uses: becheran/mlc@v0.21.0
19+
uses: becheran/mlc@18a06b3aa2901ca197de59c8b0b1f54fdba6b3fa # v1.0.0
2020
with:
21-
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*
21+
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*,https://www.npmjs.com/package/*,https://get.dot.net/
2222
- name: ⚙ Install prerequisites
2323
run: |
2424
./init.ps1 -UpgradePrerequisites

.github/workflows/libtemplate-update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
contents: write
1818
pull-requests: write
1919
steps:
20-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
20+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2121
with:
2222
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
2323

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
33
##
4-
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
4+
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
55

66
# User-specific files
77
*.rsuser

CONTRIBUTING.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ This repository can be built on Windows, Linux, and OSX.
3838

3939
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.).
4040

41-
[pwsh]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell?view=powershell-6
41+
[pwsh]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell
4242

4343
## Releases
4444

@@ -52,9 +52,9 @@ Push the tag.
5252
When your repo is hosted by GitHub and you are using GitHub Actions, you should create a GitHub Release using the standard GitHub UI.
5353
Having previously used `nbgv tag` and pushing the tag will help you identify the precise commit and name to use for this release.
5454

55-
After publishing the release, the `.github\workflows\release.yml` workflow will be automatically triggered, which will:
55+
After publishing the release, the `.github/workflows/release.yml` workflow will be automatically triggered, which will:
5656

57-
1. Find the most recent `.github\workflows\build.yml` GitHub workflow run of the tagged release.
57+
1. Find the most recent `.github/workflows/build.yml` GitHub workflow run of the tagged release.
5858
1. Upload the `deployables` artifact from that workflow run to your GitHub Release.
5959
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.
6060

@@ -65,7 +65,7 @@ Trigger the pipeline by adding the `auto-release` tag on a run of your main `azu
6565

6666
## Tutorial and API documentation
6767

68-
API and hand-written docs are found under the `docfx/` directory. and are built by [docfx](https://dotnet.github.io/docfx/).
68+
API and hand-written docs are found under the `docfx/` directory and are built by [docfx](https://dotnet.github.io/docfx/).
6969

7070
You can make changes and host the site locally to preview them by switching to that directory and running the `dotnet docfx --serve` command.
7171
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.
@@ -81,3 +81,17 @@ Configuration is in the `.github/renovate.json` file.
8181
When changing the renovate.json file, follow [these validation steps](https://docs.renovatebot.com/config-validation/).
8282

8383
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.
84+
85+
## Merging latest from Library.Template
86+
87+
### Maintaining your repo based on this template
88+
89+
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:
90+
91+
```ps1
92+
git fetch
93+
git checkout origin/main
94+
./tools/MergeFrom-Template.ps1
95+
# resolve any conflicts, then commit the merge commit.
96+
git push origin -u HEAD
97+
```

CodeQL.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
path_classifiers:
2+
library:
3+
- 'test/**'

0 commit comments

Comments
 (0)