From 2f8223bc0fc71df00a30a484973a6d6bbd4d2856 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Tue, 7 Mar 2023 23:47:27 +0700 Subject: [PATCH] Update build scripts (#244) --- build-system/azure-pipeline.template.yaml | 14 ++++++ build-system/pr-validation.yaml | 2 +- build-system/windows-release.yaml | 2 +- build.ps1 | 48 ------------------- build.sh | 20 -------- .../Akka.Persistence.Redis.csproj | 5 +- 6 files changed, 17 insertions(+), 74 deletions(-) diff --git a/build-system/azure-pipeline.template.yaml b/build-system/azure-pipeline.template.yaml index f8f7734..3364420 100644 --- a/build-system/azure-pipeline.template.yaml +++ b/build-system/azure-pipeline.template.yaml @@ -13,6 +13,20 @@ jobs: pool: vmImage: ${{ parameters.vmImage }} steps: + - task: UseDotNet@2 + displayName: 'Use .NET 7 SDK' + inputs: + version: 7.x + - task: UseDotNet@2 # to keep DocFx happy + displayName: "Use .NET 6 runtime" + inputs: + packageType: runtime + version: 6.x + - task: UseDotNet@2 + displayName: 'Use .NET Core 3 Runtime' + inputs: + packageType: runtime + version: 3.x - checkout: self # self represents the repo where the initial Pipelines YAML file was found clean: false # whether to fetch clean each time submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules diff --git a/build-system/pr-validation.yaml b/build-system/pr-validation.yaml index 4bb297f..f77ecc6 100644 --- a/build-system/pr-validation.yaml +++ b/build-system/pr-validation.yaml @@ -27,6 +27,6 @@ jobs: parameters: name: 'linux_pr' displayName: 'Linux PR Validation' - vmImage: 'ubuntu-20.04' + vmImage: 'ubuntu-latest' scriptFileName: ./build.sh scriptArgs: RunTests diff --git a/build-system/windows-release.yaml b/build-system/windows-release.yaml index 9860c58..7098a29 100644 --- a/build-system/windows-release.yaml +++ b/build-system/windows-release.yaml @@ -2,7 +2,7 @@ # See https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema for reference pool: - vmImage: vs2017-win2016 + vmImage: windows-latest demands: Cmd trigger: diff --git a/build.ps1 b/build.ps1 index 01a2834..3ac235d 100644 --- a/build.ps1 +++ b/build.ps1 @@ -30,12 +30,8 @@ Param( ) $FakeVersion = "4.61.2" -$DotNetChannel = "LTS"; -$DotNetVersion = "3.1.100"; -$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1"; $NugetVersion = "4.1.0"; $NugetUrl = "https://dist.nuget.org/win-x86-commandline/v$NugetVersion/nuget.exe" -$ProtobufVersion = "3.4.0" $DocfxVersion = "2.49.0" # Make sure tools folder exists @@ -46,50 +42,6 @@ if (!(Test-Path $ToolPath)) { New-Item -Path $ToolPath -Type directory | out-null } -########################################################################### -# INSTALL .NET CORE CLI -########################################################################### - -Function Remove-PathVariable([string]$VariableToRemove) -{ - $path = [Environment]::GetEnvironmentVariable("PATH", "User") - if ($path -ne $null) - { - $newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove } - [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User") - } - - $path = [Environment]::GetEnvironmentVariable("PATH", "Process") - if ($path -ne $null) - { - $newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove } - [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process") - } -} - -# Get .NET Core CLI path if installed. -$FoundDotNetCliVersion = $null; -if (Get-Command dotnet -ErrorAction SilentlyContinue) { - $FoundDotNetCliVersion = dotnet --version; - $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 - $env:DOTNET_CLI_TELEMETRY_OPTOUT=1 -} - -if($FoundDotNetCliVersion -ne $DotNetVersion) { - $InstallPath = Join-Path $PSScriptRoot ".dotnet" - if (!(Test-Path $InstallPath)) { - mkdir -Force $InstallPath | Out-Null; - } - (New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath\dotnet-install.ps1"); - & $InstallPath\dotnet-install.ps1 -Channel $DotNetChannel -Version $DotNetVersion -InstallDir $InstallPath -Architecture x64; - - Remove-PathVariable "$InstallPath" - $env:PATH = "$InstallPath;$env:PATH" - $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 - $env:DOTNET_CLI_TELEMETRY_OPTOUT=1 - $env:DOTNET_ROOT=$InstallPath -} - ########################################################################### # INSTALL NUGET ########################################################################### diff --git a/build.sh b/build.sh index 657ff87..fb3b8d3 100644 --- a/build.sh +++ b/build.sh @@ -11,9 +11,6 @@ NUGET_EXE=$TOOLS_DIR/nuget.exe NUGET_URL=https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe FAKE_VERSION=4.61.2 FAKE_EXE=$TOOLS_DIR/FAKE/tools/FAKE.exe -DOTNET_VERSION=3.1.100 -DOTNET_INSTALLER_URL=https://dot.net/v1/dotnet-install.sh -DOTNET_CHANNEL=LTS; DOCFX_VERSION=2.49.0 DOCFX_EXE=$TOOLS_DIR/docfx.console/tools/docfx.exe @@ -42,23 +39,6 @@ if [ ! -d "$TOOLS_DIR" ]; then mkdir "$TOOLS_DIR" fi -########################################################################### -# INSTALL .NET CORE CLI -########################################################################### - -echo "Installing .NET CLI..." -if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then - mkdir "$SCRIPT_DIR/.dotnet" -fi -curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" $DOTNET_INSTALLER_URL -bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version $DOTNET_VERSION --channel $DOTNET_CHANNEL --install-dir .dotnet --no-path -export PATH="$SCRIPT_DIR/.dotnet":$PATH -export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -export DOTNET_CLI_TELEMETRY_OPTOUT=1 -chmod -R 0755 ".dotnet" -"$SCRIPT_DIR/.dotnet/dotnet" --info - - ########################################################################### # INSTALL NUGET ########################################################################### diff --git a/src/Akka.Persistence.Redis/Akka.Persistence.Redis.csproj b/src/Akka.Persistence.Redis/Akka.Persistence.Redis.csproj index 8195433..5312da6 100644 --- a/src/Akka.Persistence.Redis/Akka.Persistence.Redis.csproj +++ b/src/Akka.Persistence.Redis/Akka.Persistence.Redis.csproj @@ -3,9 +3,8 @@ Akka.Persistence.Redis - $(NetStandardLibVersion);$(NetFrameworkLibVersion) false - $(NetStandardVersion) + $(NetStandardVersion) README.md 7.1 true @@ -22,7 +21,5 @@ - -