Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package tools to manifest #2084

Merged
merged 3 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 16 additions & 4 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,29 @@
"dotnet-cake"
]
},
"docfx": {
"version": "2.75.3",
"commands": [
"docfx"
]
},
"dotnet-validate": {
"version": "0.0.1-preview.304",
"commands": [
"dotnet-validate"
]
},
"markdownsnippets.tool": {
"version": "27.0.2",
"commands": [
"mdsnippets"
]
},
"docfx": {
"version": "2.75.3",
"sign": {
"version": "0.9.1-beta.23530.1",
"commands": [
"docfx"
"sign"
]
}
}
}
}
24 changes: 21 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:

outputs:
dotnet-sdk-version: ${{ steps.setup-dotnet.outputs.dotnet-version }}
dotnet-sign-version: ${{ steps.get-dotnet-tools-versions.outputs.dotnet-sign-version }}
dotnet-validate-version: ${{ steps.get-dotnet-tools-versions.outputs.dotnet-validate-version }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -110,6 +112,16 @@ jobs:
path: eng/signing
if-no-files-found: error

- name: Get .NET tools versions
id: get-dotnet-tools-versions
shell: pwsh
run: |
$manifest = (Get-Content "./.config/dotnet-tools.json" | Out-String | ConvertFrom-Json)
$dotnetSignVersion = $manifest.tools.sign.version
$dotnetValidateVersion = $manifest.tools.'dotnet-validate'.version
"dotnet-sign-version=${dotnetSignVersion}" >> $env:GITHUB_OUTPUT
"dotnet-validate-version=${dotnetValidateVersion}" >> $env:GITHUB_OUTPUT

validate-packages:
needs: build
runs-on: ubuntu-latest
Expand All @@ -127,8 +139,10 @@ jobs:

- name: Validate NuGet packages
shell: pwsh
env:
DOTNET_VALIDATE_VERSION: ${{ needs.build.outputs.dotnet-validate-version }}
run: |
dotnet tool install --global dotnet-validate --version 0.0.1-preview.304
dotnet tool install --global dotnet-validate --version ${env:DOTNET_VALIDATE_VERSION}
$packages = Get-ChildItem -Filter "*.nupkg" | ForEach-Object { $_.FullName }
$invalidPackages = 0
foreach ($package in $packages) {
Expand Down Expand Up @@ -168,7 +182,9 @@ jobs:
dotnet-version: ${{ needs.build.outputs.dotnet-sdk-version }}

- name: Install Sign CLI tool
run: dotnet tool install --tool-path . sign --version 0.9.1-beta.23530.1
env:
DOTNET_SIGN_VERSION: ${{ needs.build.outputs.dotnet-sign-version }}
run: dotnet tool install --tool-path . sign --version ${env:DOTNET_SIGN_VERSION}

- name: Sign artifacts
shell: pwsh
Expand Down Expand Up @@ -212,8 +228,10 @@ jobs:

- name: Validate NuGet packages
shell: pwsh
env:
DOTNET_VALIDATE_VERSION: ${{ needs.build.outputs.dotnet-validate-version }}
run: |
dotnet tool install --global dotnet-validate --version 0.0.1-preview.304
dotnet tool install --global dotnet-validate --version ${env:DOTNET_VALIDATE_VERSION}
$packages = Get-ChildItem -Filter "*.nupkg" | ForEach-Object { $_.FullName }
$invalidPackages = 0
foreach ($package in $packages) {
Expand Down
4 changes: 2 additions & 2 deletions eng/Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
</ItemGroup>

<PropertyGroup Label="MinVer">
<MinVerMinimumMajorMinor>8.3</MinVerMinimumMajorMinor>
<MinVerMinimumMajorMinor>8.4</MinVerMinimumMajorMinor>
</PropertyGroup>

<Target Name="CustomizeVersions" AfterTargets="MinVer" Condition="'$(GITHUB_ACTIONS)' == 'true'">
<PropertyGroup>
<FileVersion>$([MSBuild]::ValueOrDefault('$(MinVerMajor)', '8')).$([MSBuild]::ValueOrDefault('$(MinVerMinor)', '3')).$([MSBuild]::ValueOrDefault('$(MinVerPatch)', '0')).$(GITHUB_RUN_NUMBER)</FileVersion>
<FileVersion>$([MSBuild]::ValueOrDefault('$(MinVerMajor)', '8')).$([MSBuild]::ValueOrDefault('$(MinVerMinor)', '4')).$([MSBuild]::ValueOrDefault('$(MinVerPatch)', '0')).$(GITHUB_RUN_NUMBER)</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="$(GITHUB_REF.StartsWith(`refs/pull/`))">
<PackageVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch)-pr.$(GITHUB_REF_NAME.Replace(`/merge`, ``)).$(GITHUB_RUN_NUMBER)</PackageVersion>
Expand Down