From 7d0d360abbdae5aaf775bd77ae2e16224d6e96f8 Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Sat, 9 Dec 2023 10:56:56 -0600 Subject: [PATCH] chore: Dotnet tools are now installed locally --- .config/dotnet-tools.json | 18 ++++++++++++++++++ .github/workflows/sonarcloud.yml | 4 +--- ci/RunSonarScan.ps1 | 2 +- scripts/Install-Tooling.ps1 | 3 +-- scripts/Prepare-Release.ps1 | 2 +- 5 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 .config/dotnet-tools.json diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 00000000..4050f525 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,18 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "gitversion.tool": { + "version": "5.12.0", + "commands": [ + "dotnet-gitversion" + ] + }, + "dotnet-sonarscanner": { + "version": "6.0.0", + "commands": [ + "dotnet-sonarscanner" + ] + } + } +} \ No newline at end of file diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 89cfb0c3..a62eb12e 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -43,9 +43,7 @@ jobs: dotnet-version: ${{ env.dotnetVersion }} - name: Install Tooling - run: | - dotnet tool install --global dotnet-sonarscanner - dotnet tool install --global GitVersion.Tool + run: dotnet tool restore - name: Perform Scan run: pwsh ci/RunSonarScan.ps1 -SonarToken "${{ secrets.SONAR_TOKEN }}" diff --git a/ci/RunSonarScan.ps1 b/ci/RunSonarScan.ps1 index 3ccce28b..1e228270 100644 --- a/ci/RunSonarScan.ps1 +++ b/ci/RunSonarScan.ps1 @@ -6,7 +6,7 @@ param ( [switch] $Details ) -$version = $(dotnet-gitversion /showvariable semver) +$version = $(dotnet gitversion /showvariable semver) if ($LASTEXITCODE -ne 0) { throw "Failed: dotnet gitversion" } $beginArgs = @( diff --git a/scripts/Install-Tooling.ps1 b/scripts/Install-Tooling.ps1 index dec0d86e..949af793 100644 --- a/scripts/Install-Tooling.ps1 +++ b/scripts/Install-Tooling.ps1 @@ -1,3 +1,2 @@ -dotnet tool update --global GitVersion.Tool +dotnet tool restore Install-Module -Force -Name ChangelogManagement -dotnet tool update --global dotnet-sonarscanner diff --git a/scripts/Prepare-Release.ps1 b/scripts/Prepare-Release.ps1 index 445efa37..b059f5bd 100644 --- a/scripts/Prepare-Release.ps1 +++ b/scripts/Prepare-Release.ps1 @@ -5,7 +5,7 @@ param ( $ErrorActionPreference = "Stop" -$version = if ($Version) { $Version } else { dotnet-gitversion /showvariable SemVer } +$version = if ($Version) { $Version } else { dotnet gitversion /showvariable SemVer } Update-Changelog -ReleaseVersion $version -LinkMode Automatic -LinkPattern @{ FirstRelease = "https://github.com/recyclarr/recyclarr/releases/tag/v{CUR}"