From b74faee716e65727ecc1325182817d86a8ba1def Mon Sep 17 00:00:00 2001 From: Romfos Date: Mon, 5 Jan 2026 14:55:44 +0100 Subject: [PATCH] Drop AppVeyor in favor of GitHub Actions --- .github/workflows/release.yml | 45 +++++++++ Castle.Core.slnx | 4 +- README.md | 10 +- appveyor.yml | 91 ------------------- build.cmd | 17 ---- build.sh | 66 -------------- buildscripts/build.cmd | 55 ----------- buildscripts/common.props | 7 +- nuget.config | 7 -- .../Castle.Core.Tests.WeakNamed.csproj | 1 - .../Castle.Core.Tests.csproj | 2 +- src/Castle.Core/Castle.Core.csproj | 2 - ...le.Services.Logging.NLogIntegration.csproj | 2 - ...Services.Logging.SerilogIntegration.csproj | 2 - ...Services.Logging.log4netIntegration.csproj | 2 - 15 files changed, 52 insertions(+), 261 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100644 appveyor.yml delete mode 100644 build.cmd delete mode 100755 build.sh delete mode 100644 buildscripts/build.cmd delete mode 100644 nuget.config diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..941fe14e5f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: Release +on: + workflow_dispatch: + inputs: + version: + description: "Nuget package version" + required: true + type: string + publish: + description: "Publish to nuget" + type: boolean + required: true + default: false +run-name: Release ${{ inputs.Version }} + +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 10.0.x + + - name: Build package + run: dotnet pack ./Castle.Core.slnx -p:Version=${{ inputs.Version }} -o ./build -p:CI=true + + - name: Make explicit versions for nuget packages + run: dotnet run --project .\tools\Explicit.NuGet.Versions\Explicit.NuGet.Versions.csproj ".\build" "castle." + + - name: Publish to nuget.org + if: inputs.publish == 'true' + run: dotnet nuget push ./build/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json + + - name: Upload packages + uses: actions/upload-artifact@v5 + with: + name: packages + path: | + build/*.nupkg + build/*.snupkg + retention-days: 30 \ No newline at end of file diff --git a/Castle.Core.slnx b/Castle.Core.slnx index 88133c4241..ffb870dd9c 100644 --- a/Castle.Core.slnx +++ b/Castle.Core.slnx @@ -3,9 +3,6 @@ - - - @@ -14,6 +11,7 @@ + diff --git a/README.md b/README.md index 56f7c8592a..7e8d72ed04 100644 --- a/README.md +++ b/README.md @@ -32,16 +32,10 @@ Running the unit tests additionally requires the .NET Framework 4.6.2+ and the . |-----------------|------------| | Windows & Linux | [Preview Feed](https://ci.appveyor.com/nuget/core-0mhe40ifodk8) -### On Windows +### On Windows/linux/macOS ``` -build.cmd -``` - -### On Linux - -``` -./build.sh +dotnet build Castle.Core.slnx ``` :information_source: **Mono runtime support:** We used to run tests on the Mono 6.0 runtime, but stopped doing so as the project has been deprecated. See the official announcement on [the Mono homepage](https://www.mono-project.com/). diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index a9a39ed10e..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,91 +0,0 @@ -image: -- Visual Studio 2022 -- Ubuntu2204 - - -# ---------------- -# ALL BUILD JOBS -# ---------------- -skip_tags: false -test: off - - -for: -- # ----------------- - # LINUX BUILD JOB - # ----------------- - matrix: - only: - - image: Ubuntu2204 - - # install .NET 10 SDK - install: - - curl -L https://dot.net/v1/dotnet-install.sh -o dotnet-install.sh - - chmod +x ./dotnet-install.sh - - sudo ./dotnet-install.sh --channel 10.0 --install-dir /usr/share/dotnet - - # build and run tests - build_script: - - uname -a - - ./build.sh - - # upload test results - after_build: - - find "$APPVEYOR_BUILD_FOLDER" -type f -name '*TestResults.xml' -print0 | xargs -0 -I '{}' curl -F 'file=@{}' "https://ci.appveyor.com/api/testresults/nunit3/$APPVEYOR_JOB_ID" - - # deployment is handled exclusively by the Windows build job (below) - deploy: off - - -- # ------------------- - # WINDOWS BUILD JOB - # ------------------- - matrix: - only: - - image: Visual Studio 2022 - - # update AppVeyor build version; this matters for deployments - init: - - ps: | - if ($env:APPVEYOR_REPO_TAG -eq "true") - { - Update-AppveyorBuild -Version ($env:APPVEYOR_REPO_TAG_NAME).TrimStart("v") - } - - # install .NET 10 SDK - install: - - cmd: choco install dotnet-10.0-sdk - - # build and run tests - build_script: - - cmd: build.cmd - - # upload test results - after_build: - - ps: | - $wc = New-Object System.Net.WebClient - $wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "Net80TestResults.xml")) - $wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "Net80WeakNamedTestResults.xml")) - $wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "Net90TestResults.xml")) - $wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "Net90WeakNamedTestResults.xml")) - $wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "DesktopClrTestResults.xml")) - $wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "DesktopClrWeakNamedTestResults.xml")) - - # push packages to NuGet on tag builds - on_success: - - ps: | - if ($env:APPVEYOR_REPO_TAG -eq "true") - { - nuget push ".\build\Castle.Core.${env:APPVEYOR_BUILD_VERSION}.nupkg" -ApiKey $env:NUGET_API_KEY -Source https://api.nuget.org/v3/index.json - nuget push ".\build\Castle.Core-log4net.${env:APPVEYOR_BUILD_VERSION}.nupkg" -ApiKey $env:NUGET_API_KEY -Source https://api.nuget.org/v3/index.json - nuget push ".\build\Castle.Core-NLog.${env:APPVEYOR_BUILD_VERSION}.nupkg" -ApiKey $env:NUGET_API_KEY -Source https://api.nuget.org/v3/index.json - nuget push ".\build\Castle.Core-Serilog.${env:APPVEYOR_BUILD_VERSION}.nupkg" -ApiKey $env:NUGET_API_KEY -Source https://api.nuget.org/v3/index.json - nuget push ".\build\Castle.Core-DiagnosticsLogger.${env:APPVEYOR_BUILD_VERSION}.nupkg" -ApiKey $env:NUGET_API_KEY -Source https://api.nuget.org/v3/index.json - } - - # upload packages to AppVeyor - artifacts: - - path: build\*.nupkg - name: library - - path: build\*.snupkg - name: symbols \ No newline at end of file diff --git a/build.cmd b/build.cmd deleted file mode 100644 index 119de998ee..0000000000 --- a/build.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO OFF -REM **************************************************************************** -REM Copyright 2004-2021 Castle Project - http://www.castleproject.org/ -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM **************************************************************************** - -@call buildscripts\build.cmd %* diff --git a/build.sh b/build.sh deleted file mode 100755 index a091126b7b..0000000000 --- a/build.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# **************************************************************************** -# Copyright 2004-2025 Castle Project - http://www.castleproject.org/ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# **************************************************************************** -shopt -s expand_aliases - -dotnet --list-sdks - -echo --------------------------- -echo Build -echo --------------------------- - -dotnet build ./Castle.Core.slnx --configuration Release --tl:off - -echo --------------------------- -echo Running NET8.0 Tests -echo --------------------------- - -dotnet test ./src/Castle.Core.Tests -f net8.0 -c Release --no-build -- NUnit.TestOutputXml="$PWD" NUnit.TestOutputXmlFileName="Net80TestResults" -dotnet test ./src/Castle.Core.Tests.WeakNamed -f net8.0 -c Release --no-build -- NUnit.TestOutputXml="$PWD" NUnit.TestOutputXmlFileName="Net80WeakNamedTestResults" - -# Ensure that all test runs produced a protocol file: -if [[ !( -f Net80TestResults.xml && - -f Net80WeakNamedTestResults.xml ) ]]; then - echo "Incomplete test results. Some test runs might not have terminated properly. Failing the build." - exit 1 -fi - -NET80_FAILCOUNT=$(grep -F "One or more child tests had errors" Net80TestResults.xml Net80WeakNamedTestResults.xml | wc -l) -if [ $NET80_FAILCOUNT -ne 0 ] -then - echo "Net8.0 Tests have failed, failing the build" - exit 1 -fi - -echo --------------------------- -echo Running NET9.0 Tests -echo --------------------------- - -dotnet test ./src/Castle.Core.Tests -f net9.0 -c Release --no-build -- NUnit.TestOutputXml="$PWD" NUnit.TestOutputXmlFileName="Net90TestResults" -dotnet test ./src/Castle.Core.Tests.WeakNamed -f net9.0 -c Release --no-build -- NUnit.TestOutputXml="$PWD" NUnit.TestOutputXmlFileName="Net90WeakNamedTestResults" - -# Ensure that all test runs produced a protocol file: -if [[ !( -f Net90TestResults.xml && - -f Net90WeakNamedTestResults.xml ) ]]; then - echo "Incomplete test results. Some test runs might not have terminated properly. Failing the build." - exit 1 -fi - -NET90_FAILCOUNT=$(grep -F "One or more child tests had errors" Net90TestResults.xml Net90WeakNamedTestResults.xml | wc -l) -if [ $NET90_FAILCOUNT -ne 0 ] -then - echo "Net9.0 Tests have failed, failing the build" - exit 1 -fi diff --git a/buildscripts/build.cmd b/buildscripts/build.cmd deleted file mode 100644 index 38dd052309..0000000000 --- a/buildscripts/build.cmd +++ /dev/null @@ -1,55 +0,0 @@ -@ECHO OFF -REM **************************************************************************** -REM Copyright 2004-2025 Castle Project - http://www.castleproject.org/ -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM **************************************************************************** - -if "%1" == "" goto no_config -if "%1" NEQ "" goto set_config - -:set_config -SET Configuration=%1 -GOTO build - -:no_config -SET Configuration=Release -GOTO build - -:build -dotnet build ./tools/Explicit.NuGet.Versions/Explicit.NuGet.Versions.slnx -dotnet build --configuration %Configuration% || exit /b 1 -.\tools\Explicit.NuGet.Versions\build\nev.exe ".\build" "castle." -GOTO test - -:test - -echo -------------------- -echo Running NET462 Tests -echo -------------------- - -dotnet test src\Castle.Core.Tests -f net462 -c %Configuration% --no-build -- NUnit.TestOutputXml="%CD%" NUnit.TestOutputXmlFileName="DesktopClrTestResults" || exit /b 1 -dotnet test src\Castle.Core.Tests.WeakNamed -f net462 -c %Configuration% --no-build -- NUnit.TestOutputXml="%CD%" NUnit.TestOutputXmlFileName="DesktopClrWeakNamedTestResults" || exit /b 1 - -echo --------------------------- -echo Running NET8.0 Tests -echo --------------------------- - -dotnet test src\Castle.Core.Tests -f net8.0 -c %Configuration% --no-build -- NUnit.TestOutputXml="%CD%" NUnit.TestOutputXmlFileName="Net80TestResults" || exit /b 1 -dotnet test src\Castle.Core.Tests.WeakNamed -f net8.0 -c %Configuration% --no-build -- NUnit.TestOutputXml="%CD%" NUnit.TestOutputXmlFileName="Net80WeakNamedTestResults" || exit /b 1 - -echo --------------------------- -echo Running NET9.0 Tests -echo --------------------------- - -dotnet test src\Castle.Core.Tests -f net9.0 -c %Configuration% --no-build -- NUnit.TestOutputXml="%CD%" NUnit.TestOutputXmlFileName="Net90TestResults" || exit /b 1 -dotnet test src\Castle.Core.Tests.WeakNamed -f net9.0 -c %Configuration% --no-build -- NUnit.TestOutputXml="%CD%" NUnit.TestOutputXmlFileName="Net90WeakNamedTestResults" || exit /b 1 \ No newline at end of file diff --git a/buildscripts/common.props b/buildscripts/common.props index ba84c3b188..b5dc109470 100644 --- a/buildscripts/common.props +++ b/buildscripts/common.props @@ -8,7 +8,7 @@ git https://github.com/castleproject/Core 0.0.0 - $(APPVEYOR_BUILD_VERSION) + $(Version) $(BuildVersion.Split('.')[0]) $(BuildVersion.Split('-')[0]) true @@ -27,9 +27,6 @@ http://www.castleproject.org/img/castle-logo.png castle-logo.png false - $(BuildVersion) - true - false $([System.DateTime]::Now.ToString("yyyy")) Copyright (c) 2004-$(CurrentYear) Castle Project - http://www.castleproject.org/ . @@ -39,6 +36,8 @@ true true + true + snupkg diff --git a/nuget.config b/nuget.config deleted file mode 100644 index af7ed10fdd..0000000000 --- a/nuget.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/Castle.Core.Tests.WeakNamed/Castle.Core.Tests.WeakNamed.csproj b/src/Castle.Core.Tests.WeakNamed/Castle.Core.Tests.WeakNamed.csproj index 803f96f096..b8aebd5dae 100644 --- a/src/Castle.Core.Tests.WeakNamed/Castle.Core.Tests.WeakNamed.csproj +++ b/src/Castle.Core.Tests.WeakNamed/Castle.Core.Tests.WeakNamed.csproj @@ -24,7 +24,6 @@ - diff --git a/src/Castle.Core.Tests/Castle.Core.Tests.csproj b/src/Castle.Core.Tests/Castle.Core.Tests.csproj index bef128f28a..547ad7c9be 100644 --- a/src/Castle.Core.Tests/Castle.Core.Tests.csproj +++ b/src/Castle.Core.Tests/Castle.Core.Tests.csproj @@ -58,7 +58,7 @@ - + \ No newline at end of file diff --git a/src/Castle.Core/Castle.Core.csproj b/src/Castle.Core/Castle.Core.csproj index 7d45404a57..b8c776cd02 100644 --- a/src/Castle.Core/Castle.Core.csproj +++ b/src/Castle.Core/Castle.Core.csproj @@ -8,8 +8,6 @@ Castle.Core - True - ../../build/ Castle.Core Castle Castle Core diff --git a/src/Castle.Services.Logging.NLogIntegration/Castle.Services.Logging.NLogIntegration.csproj b/src/Castle.Services.Logging.NLogIntegration/Castle.Services.Logging.NLogIntegration.csproj index 5cca724349..c68bd0d1cc 100644 --- a/src/Castle.Services.Logging.NLogIntegration/Castle.Services.Logging.NLogIntegration.csproj +++ b/src/Castle.Services.Logging.NLogIntegration/Castle.Services.Logging.NLogIntegration.csproj @@ -8,8 +8,6 @@ Castle.Core-NLog - True - ../../build/ Castle.Services.Logging.NLogIntegration Castle.Services.Logging.NLogIntegration Castle NLog integration diff --git a/src/Castle.Services.Logging.SerilogIntegration/Castle.Services.Logging.SerilogIntegration.csproj b/src/Castle.Services.Logging.SerilogIntegration/Castle.Services.Logging.SerilogIntegration.csproj index 8d3e790f87..2e6342a29a 100644 --- a/src/Castle.Services.Logging.SerilogIntegration/Castle.Services.Logging.SerilogIntegration.csproj +++ b/src/Castle.Services.Logging.SerilogIntegration/Castle.Services.Logging.SerilogIntegration.csproj @@ -8,8 +8,6 @@ Castle.Core-Serilog - True - ../../build/ Castle.Services.Logging.SerilogIntegration Castle.Services.Logging.SerilogIntegration Castle Serilog integration diff --git a/src/Castle.Services.Logging.log4netIntegration/Castle.Services.Logging.log4netIntegration.csproj b/src/Castle.Services.Logging.log4netIntegration/Castle.Services.Logging.log4netIntegration.csproj index e2a50dff29..73c8cd72d7 100644 --- a/src/Castle.Services.Logging.log4netIntegration/Castle.Services.Logging.log4netIntegration.csproj +++ b/src/Castle.Services.Logging.log4netIntegration/Castle.Services.Logging.log4netIntegration.csproj @@ -8,8 +8,6 @@ Castle.Core-log4net - True - ../../build/ Castle.Services.Logging.Log4netIntegration Castle.Services.Logging.Log4netIntegration Castle log4net integration