Skip to content

Commit eb339e2

Browse files
Merge pull request #79 from microsoft/library.template/2024-11-19
Library.template/2024 11 19
2 parents aa1b8e3 + f4c28a3 commit eb339e2

File tree

15 files changed

+124
-17
lines changed

15 files changed

+124
-17
lines changed

.config/dotnet-tools.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
"isRoot": true,
44
"tools": {
55
"powershell": {
6-
"version": "7.4.5",
6+
"version": "7.4.6",
77
"commands": [
88
"pwsh"
99
]
1010
},
1111
"dotnet-coverage": {
12-
"version": "17.12.5",
12+
"version": "17.12.6",
1313
"commands": [
1414
"dotnet-coverage"
1515
]
1616
},
1717
"nbgv": {
18-
"version": "3.6.143",
18+
"version": "3.6.146",
1919
"commands": [
2020
"nbgv"
2121
]

.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:8.0.402-jammy
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.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Library.Template update
2+
3+
# PREREQUISITE: This workflow requires the repo to be configured to allow workflows to push commits and create pull requests.
4+
# Visit https://github.com/USER/REPO/settings/actions
5+
# Under "Workflow permissions", select "Read and write permissions" and 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+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
20+
21+
- name: merge
22+
shell: pwsh
23+
run: |
24+
$LibTemplateBranch = & ./azure-pipelines/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated
25+
if ($LASTEXITCODE -ne 0) {
26+
exit $LASTEXITCODE
27+
}
28+
29+
git fetch https://github.com/aarnott/Library.Template $LibTemplateBranch
30+
if ($LASTEXITCODE -ne 0) {
31+
exit $LASTEXITCODE
32+
}
33+
$LibTemplateCommit = git rev-parse FETCH_HEAD
34+
35+
if ((git rev-list FETCH_HEAD ^HEAD --count) -eq 0) {
36+
Write-Host "There are no Library.Template updates to merge."
37+
exit 0
38+
}
39+
40+
git -c http.extraheader="AUTHORIZATION: bearer $env:GH_TOKEN" push origin -u FETCH_HEAD:refs/heads/auto/libtemplateUpdate
41+
- name: pull request
42+
shell: pwsh
43+
run: |
44+
# If there is already an active pull request, don't create a new one.
45+
$existingPR = gh pr list -H auto/libtemplateUpdate --json url | ConvertFrom-Json
46+
if ($existingPR) {
47+
Write-Host "::warning::Skipping pull request creation because one already exists at $($existingPR[0].url)"
48+
exit 0
49+
}
50+
51+
$prTitle = "Merge latest Library.Template"
52+
$prBody = "This merges the latest features and fixes from [Library.Template's branch](https://github.com/AArnott/Library.Template/tree/).
53+
54+
<details>
55+
<summary>Merge conflicts?</summary>
56+
Resolve merge conflicts locally by carrying out these steps:
57+
58+
```
59+
git fetch
60+
git checkout auto/libtemplateUpdate
61+
git merge origin/main
62+
# resolve conflicts
63+
git commit
64+
git push
65+
```
66+
</details>
67+
68+
⚠️ Do **not** squash this pull request when completing it. You must *merge* it."
69+
70+
gh pr create -H auto/libtemplateUpdate -b $prBody -t $prTitle
71+
env:
72+
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

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
66
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
77

8-
<MicroBuildVersion>2.0.165</MicroBuildVersion>
8+
<MicroBuildVersion>2.0.171</MicroBuildVersion>
99
</PropertyGroup>
1010
<ItemGroup>
1111
<PackageVersion Include="IsExternalInit" Version="1.0.3" />
@@ -24,7 +24,7 @@
2424
<GlobalPackageReference Include="CSharpIsNullAnalyzer" Version="0.1.593" />
2525
<GlobalPackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" />
2626
<GlobalPackageReference Include="Microsoft.VisualStudio.Internal.MicroBuild.VisualStudio" Version="$(MicroBuildVersion)" />
27-
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.143" />
27+
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.146" />
2828
<GlobalPackageReference Include="Nullable" Version="1.3.1" />
2929
<GlobalPackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.556" />
3030
</ItemGroup>

azure-pipelines/OptProf_part2.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ resources:
1414
- pipeline: DartLab.OptProf
1515
source: DartLab.OptProf
1616
branch: main
17+
tags:
18+
- production
1719
repositories:
1820
- repository: DartLabTemplates
1921
type: git
@@ -22,7 +24,7 @@ resources:
2224
- repository: DartLabOptProfTemplates
2325
type: git
2426
name: DartLab.OptProf
25-
ref: refs/heads/main
27+
ref: refs/tags/Production
2628

2729
parameters:
2830

azure-pipelines/Publish-Legacy-Symbols.ps1 renamed to azure-pipelines/Prepare-Legacy-Symbols.ps1

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,3 @@ Get-ChildItem "$ArtifactStagingFolder\*.pdb" -Recurse |% {
3333
Move-Item $legacyPdbPath $_ -Force
3434
}
3535
}
36-
37-
Write-Host "##vso[artifact.upload containerfolder=symbols-legacy;artifactname=symbols-legacy;]$ArtifactStagingFolder"

azure-pipelines/build.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ parameters:
44
##### Feel free to adjust their default value as needed.
55

66
# Whether this repo uses OptProf to optimize the built binaries.
7+
# When enabling this, be sure to update these files:
8+
# - OptProf.targets: InstallationPath and match TestCase selection with what's in the VS repo.
9+
# - The project file(s) for the libraries to optimize must import OptProf.targets (for multi-targeted projects, only import it for ONE target).
10+
# - OptProf.yml: Search for LibraryName (or your library's name) and verify that those names are appropriate.
11+
# - OptProf_part2.yml: Search for LibraryName (or your library's name) and verify that those names are appropriate.
12+
# and create pipelines for OptProf.yml, OptProf_part2.yml
713
- name: EnableOptProf
814
type: boolean
915
default: false
@@ -94,7 +100,7 @@ parameters:
94100
- name: macOSPool
95101
type: object
96102
default:
97-
vmImage: macOS-12
103+
vmImage: macOS-14
98104

99105
jobs:
100106
- job: Windows
@@ -270,6 +276,15 @@ jobs:
270276
- macOS
271277
pool: ${{ parameters.windowsPool }} # Use Windows agent because PublishSymbols task requires it (https://github.com/microsoft/azure-pipelines-tasks/issues/13821).
272278
condition: succeededOrFailed()
279+
${{ if eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9') }}:
280+
templateContext:
281+
outputParentDirectory: $(Build.ArtifactStagingDirectory)
282+
outputs:
283+
- output: pipelineArtifact
284+
displayName: 📢 Publish symbols-legacy
285+
targetPath: $(Build.ArtifactStagingDirectory)/symbols-legacy
286+
artifactName: symbols-legacy
287+
condition: succeededOrFailed()
273288
steps:
274289
- checkout: self
275290
fetchDepth: 0 # avoid shallow clone so nbgv can do its work.

azure-pipelines/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ parameters:
88

99
steps:
1010

11-
- script: dotnet build -t:build,pack --no-restore -c $(BuildConfiguration) -warnaserror /bl:"$(Build.ArtifactStagingDirectory)/build_logs/build.binlog"
11+
- script: dotnet build -t:build,pack --no-restore -c $(BuildConfiguration) -warnAsError -warnNotAsError:NU1901,NU1902,NU1903,NU1904 /bl:"$(Build.ArtifactStagingDirectory)/build_logs/build.binlog"
1212
displayName: 🛠 dotnet build
1313

1414
- ${{ if not(parameters.IsOptProf) }}:

azure-pipelines/microbuild.after.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ steps:
2929
usePat: true
3030
displayName: 📢 Publish to Artifact Services - ProfilingInputs
3131
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
32-
continueOnError: true
3332

3433
- task: PublishBuildArtifacts@1
3534
inputs:

0 commit comments

Comments
 (0)