Skip to content

Commit

Permalink
Remove references to .NET 6 (#894)
Browse files Browse the repository at this point in the history
* Remove net6.0 references and update some nuget packages

* NUnit and more dependency upgrades in tests

* Update more dependencies

* Nuke Update

* slightly nicer error messages in fixture

* Need to revert ILRepack to older version or it doesn't internalize tinytypes properly. Update other deps

* Disable buggy test
  • Loading branch information
borland authored Nov 17, 2024
1 parent 1d7b99b commit 42bc730
Show file tree
Hide file tree
Showing 25 changed files with 352 additions and 375 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ jobs:
with:
fetch-depth: 0 # all

- name: Setup .NET 6.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x

- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
Expand Down Expand Up @@ -79,15 +74,6 @@ jobs:
reporter: dotnet-trx
fail-on-error: true

- name: Windows .NET 6.0 unit test report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Windows .Net 6.0 unit test results
path: ./TestResults/Win_net6.0_*.trx
reporter: dotnet-trx
fail-on-error: true

- name: Windows .NET 8.0 unit test report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
Expand Down Expand Up @@ -117,15 +103,6 @@ jobs:
reporter: dotnet-trx
fail-on-error: true

- name: Windows .NET 6.0 E2E test report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Windows .NET 6.0 E2E test results
path: ./TestResults/Win-E2E_net6.0_*.trx
reporter: dotnet-trx
fail-on-error: true

- name: Windows .NET 8.0 E2E test report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
Expand Down Expand Up @@ -161,11 +138,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup .NET 6.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x

- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
Expand All @@ -191,11 +163,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup .NET 6.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x

- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
Expand Down
191 changes: 96 additions & 95 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,56 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/build",
"title": "Build Schema",
"definitions": {
"build": {
"type": "object",
"Host": {
"type": "string",
"enum": [
"AppVeyor",
"AzurePipelines",
"Bamboo",
"Bitbucket",
"Bitrise",
"GitHubActions",
"GitLab",
"Jenkins",
"Rider",
"SpaceAutomation",
"TeamCity",
"Terminal",
"TravisCI",
"VisualStudio",
"VSCode"
]
},
"ExecutableTarget": {
"type": "string",
"enum": [
"Clean",
"Compile",
"CopyToLocalPackages",
"CopyUnsignedNugetToLocalPackages",
"Default",
"Merge",
"PackSignedMergedClientNuget",
"PackSignedNormalClientNuget",
"PackUnsignedNonMergedClientNuget",
"PackUnsignedNormalClientNuget",
"Restore",
"Test",
"TestClientNugetPackage"
]
},
"Verbosity": {
"type": "string",
"description": "",
"enum": [
"Verbose",
"Normal",
"Minimal",
"Quiet"
]
},
"NukeBuild": {
"properties": {
"AutoDetectBranch": {
"type": "boolean",
"description": "Whether to auto-detect the branch name - this is okay for a local build, but should not be used under CI"
},
"AzureKeyVaultAppId": {
"type": "string"
},
"AzureKeyVaultAppSecret": {
"type": "string",
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
},
"AzureKeyVaultCertificateName": {
"type": "string"
},
"AzureKeyVaultTenantId": {
"type": "string"
},
"AzureKeyVaultUrl": {
"type": "string"
},
"Configuration": {
"type": "string"
},
"Continue": {
"type": "boolean",
"description": "Indicates to continue a previously failed build attempt"
Expand All @@ -38,34 +60,13 @@
"description": "Shows the help text for this build assembly"
},
"Host": {
"type": "string",
"description": "Host for execution. Default is 'automatic'",
"enum": [
"AppVeyor",
"AzurePipelines",
"Bamboo",
"Bitbucket",
"Bitrise",
"GitHubActions",
"GitLab",
"Jenkins",
"Rider",
"SpaceAutomation",
"TeamCity",
"Terminal",
"TravisCI",
"VisualStudio",
"VSCode"
]
"$ref": "#/definitions/Host"
},
"NoLogo": {
"type": "boolean",
"description": "Disables displaying the NUKE logo"
},
"OCTOVERSION_CurrentBranch": {
"type": "string",
"description": "Branch name for OctoVersion to use to calculate the version number. Can be set via the environment variable OCTOVERSION_CurrentBranch"
},
"Partition": {
"type": "string",
"description": "Partition to use on CI"
Expand All @@ -85,67 +86,67 @@
"type": "string",
"description": "Root directory during build execution"
},
"SigningCertificatePassword": {
"type": "string"
},
"SigningCertificatePath": {
"type": "string"
},
"Skip": {
"type": "array",
"description": "List of targets to be skipped. Empty list skips all dependencies",
"items": {
"type": "string",
"enum": [
"Clean",
"Compile",
"CopyToLocalPackages",
"CopyUnsignedNugetToLocalPackages",
"Default",
"Merge",
"PackSignedMergedClientNuget",
"PackSignedNormalClientNuget",
"PackUnsignedNonMergedClientNuget",
"PackUnsignedNormalClientNuget",
"Restore",
"Test",
"TestClientNugetPackage"
]
"$ref": "#/definitions/ExecutableTarget"
}
},
"Target": {
"type": "array",
"description": "List of targets to be invoked. Default is '{default_target}'",
"items": {
"type": "string",
"enum": [
"Clean",
"Compile",
"CopyToLocalPackages",
"CopyUnsignedNugetToLocalPackages",
"Default",
"Merge",
"PackSignedMergedClientNuget",
"PackSignedNormalClientNuget",
"PackUnsignedNonMergedClientNuget",
"PackUnsignedNormalClientNuget",
"Restore",
"Test",
"TestClientNugetPackage"
]
"$ref": "#/definitions/ExecutableTarget"
}
},
"Verbosity": {
"type": "string",
"description": "Logging verbosity during build execution. Default is 'Normal'",
"enum": [
"Minimal",
"Normal",
"Quiet",
"Verbose"
]
"$ref": "#/definitions/Verbosity"
}
}
}
},
"allOf": [
{
"properties": {
"AutoDetectBranch": {
"type": "boolean",
"description": "Whether to auto-detect the branch name - this is okay for a local build, but should not be used under CI"
},
"AzureKeyVaultAppId": {
"type": "string"
},
"AzureKeyVaultAppSecret": {
"type": "string",
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
},
"AzureKeyVaultCertificateName": {
"type": "string"
},
"AzureKeyVaultTenantId": {
"type": "string"
},
"AzureKeyVaultUrl": {
"type": "string"
},
"Configuration": {
"type": "string"
},
"OCTOVERSION_CurrentBranch": {
"type": "string",
"description": "Branch name for OctoVersion to use to calculate the version number. Can be set via the environment variable OCTOVERSION_CurrentBranch"
},
"SigningCertificatePassword": {
"type": "string"
},
"SigningCertificatePath": {
"type": "string"
}
}
},
{
"$ref": "#/definitions/NukeBuild"
}
}
]
}
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
:; exit $?

@ECHO OFF
powershell -ExecutionPolicy ByPass -NoProfile "%~dp0build.ps1" %*
powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %*
18 changes: 11 additions & 7 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Param(
[string[]]$BuildArguments
)

$env:LOCAL_TEST_DIR = "$(Get-Location)\TestResults"
Write-Output "PowerShell $($PSVersionTable.PSEdition) version $($PSVersionTable.PSVersion)"

Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { Write-Error $_ -ErrorAction Continue; exit 1 }
Expand All @@ -19,11 +18,10 @@ $TempDirectory = "$PSScriptRoot\\.nuke\temp"

$DotNetGlobalFile = "$PSScriptRoot\\global.json"
$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1"
$DotNetChannel = "Current"
$DotNetChannel = "STS"

$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
$env:DOTNET_MULTILEVEL_LOOKUP = 0
$env:DOTNET_NOLOGO = 1

###########################################################################
# EXECUTION
Expand Down Expand Up @@ -57,14 +55,20 @@ else {
# Install by channel or version
$DotNetDirectory = "$TempDirectory\dotnet-win"
if (!(Test-Path variable:DotNetVersion)) {
ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath }
ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath }
} else {
ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
}
$env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe"
$env:PATH = "$DotNetDirectory;$env:PATH"
}

Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)"
Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)"

if (Test-Path env:NUKE_ENTERPRISE_TOKEN) {
& $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null
& $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null
}

ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments }
15 changes: 10 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp"

DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"
DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh"
DOTNET_CHANNEL="Current"
DOTNET_CHANNEL="STS"

export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_MULTILEVEL_LOOKUP=0
export LOCAL_TEST_DIR=$PWD/TestResults
export DOTNET_NOLOGO=1

###########################################################################
# EXECUTION
###########################################################################
Expand Down Expand Up @@ -54,9 +53,15 @@ else
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path
fi
export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet"
export PATH="$DOTNET_DIRECTORY:$PATH"
fi

echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)"
echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)"

if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "$NUKE_ENTERPRISE_TOKEN" != "" ]]; then
"$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true
"$DOTNET_EXE" nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password "$NUKE_ENTERPRISE_TOKEN" --store-password-in-clear-text &>/dev/null || true
fi

"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet
"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@"
Loading

0 comments on commit 42bc730

Please sign in to comment.