Skip to content

Commit 3b875b6

Browse files
Use tools manifest for dotnet-validate version (#250)
Use a .NET tools manifest to manage the version of dotnet-validate, which then can be updated by renovate. Also bumps the version to `0.0.1-preview.537`.
1 parent 938509d commit 3b875b6

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

.config/dotnet-tools.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"dotnet-validate": {
6+
"version": "0.0.1-preview.537",
7+
"commands": [
8+
"dotnet-validate"
9+
],
10+
"rollForward": false
11+
}
12+
}
13+
}

.github/workflows/ci.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626

2727
outputs:
2828
dotnet-sdk-version: ${{ steps.setup-dotnet.outputs.dotnet-version }}
29+
dotnet-validate-version: ${{ steps.get-dotnet-tools-versions.outputs.dotnet-validate-version }}
2930

3031
permissions:
3132
attestations: write
@@ -89,6 +90,14 @@ jobs:
8990
path: ./artifacts/package/release
9091
if-no-files-found: error
9192

93+
- name: Get .NET tools versions
94+
id: get-dotnet-tools-versions
95+
shell: pwsh
96+
run: |
97+
$manifest = (Get-Content "./.config/dotnet-tools.json" | Out-String | ConvertFrom-Json)
98+
$dotnetValidateVersion = $manifest.tools.'dotnet-validate'.version
99+
"dotnet-validate-version=${dotnetValidateVersion}" >> ${env:GITHUB_OUTPUT}
100+
92101
validate-packages:
93102
needs: build-test
94103
runs-on: ubuntu-latest
@@ -106,8 +115,10 @@ jobs:
106115

107116
- name: Validate NuGet packages
108117
shell: pwsh
118+
env:
119+
DOTNET_VALIDATE_VERSION: ${{ needs.build-test.outputs.dotnet-validate-version }}
109120
run: |
110-
dotnet tool install --global dotnet-validate --version 0.0.1-preview.304 --allow-roll-forward
121+
dotnet tool install --global dotnet-validate --version ${env:DOTNET_VALIDATE_VERSION} --allow-roll-forward
111122
$packages = Get-ChildItem -Filter "*.nupkg" | ForEach-Object { $_.FullName }
112123
$invalidPackages = 0
113124
foreach ($package in $packages) {

0 commit comments

Comments
 (0)