diff --git a/.gitea/workflows/branch-build.yml b/.gitea/workflows/branch-build.yml new file mode 100644 index 0000000..f906c34 --- /dev/null +++ b/.gitea/workflows/branch-build.yml @@ -0,0 +1,62 @@ +name: Branch Build + +on: + push: + branches: + - '**' + +env: + TZ: 'Europe/Berlin' + LANG: 'de' + CONFIGURATION: 'Debug' + GITEA_SERVER_URL: ${{ gitea.server_url }} + +jobs: + build-test-deploy: + runs-on: ubuntu + defaults: + run: + shell: bash + steps: + - name: Checkout repository code + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Setup dotnet + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 10.x + cache: false + + - name: Restore dependencies + run: | + set -ex + dotnet restore -v q + echo "CI_SERVER_HOST=${GITEA_SERVER_URL#https://}" >> "$GITEA_ENV" + + - name: Setup tools + run: | + set -ex + dotnet tool install dotnet-reportgenerator-globaltool --tool-path /dotnet-tools + + - name: Build solution + run: | + set -ex + shopt -s globstar + mkdir /artifacts + dotnet build -c ${CONFIGURATION} --no-restore --nologo + mv ./**/*.nupkg /artifacts/ || true + mv ./**/*.snupkg /artifacts/ || true + + - name: Test solution + run: | + set -ex + dotnet test -c ${CONFIGURATION} --no-build --nologo /p:CoverletOutputFormat=Cobertura + /dotnet-tools/reportgenerator "-reports:${{ gitea.workspace }}/**/coverage.cobertura.xml" "-targetdir:/reports" "-reportType:TextSummary" + cat /reports/Summary.txt + + - name: Publish packages + run: | + set -ex + dotnet nuget push -k "${{ secrets.BAGET_APIKEY }}" -s https://nuget.home.am-wd.de/v3/index.json --skip-duplicate /artifacts/*.nupkg \ No newline at end of file diff --git a/.gitea/workflows/release-build.yml b/.gitea/workflows/release-build.yml new file mode 100644 index 0000000..5858993 --- /dev/null +++ b/.gitea/workflows/release-build.yml @@ -0,0 +1,61 @@ +name: Release Build + +on: + push: + tags: + - '**' + +env: + TZ: 'Europe/Berlin' + LANG: 'de' + CONFIGURATION: 'Release' + GITEA_SERVER_URL: ${{ gitea.server_url }} + CI_COMMIT_TAG: ${{ gitea.ref_name }} + +jobs: + build-test-deploy: + runs-on: ubuntu + steps: + - name: Checkout repository code + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Setup dotnet + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 10.x + cache: false + + - name: Restore dependencies + run: | + set -ex + dotnet restore -v q + echo "CI_SERVER_HOST=${GITEA_SERVER_URL#https://}" >> "$GITEA_ENV" + + - name: Setup tools + run: | + set -ex + dotnet tool install dotnet-reportgenerator-globaltool --tool-path /dotnet-tools + dotnet tool install docfx --tool-path /dotnet-tools + + - name: Build solution + run: | + set -ex + shopt -s globstar + mkdir /artifacts + dotnet build -c ${CONFIGURATION} --no-restore --nologo + mv ./**/*.nupkg /artifacts/ || true + mv ./**/*.snupkg /artifacts/ || true + + - name: Test solution + run: | + set -ex + dotnet test -c ${CONFIGURATION} --no-build --nologo /p:CoverletOutputFormat=Cobertura + /dotnet-tools/reportgenerator "-reports:${{ gitea.workspace }}/**/coverage.cobertura.xml" "-targetdir:/reports" "-reportType:TextSummary" + cat /reports/Summary.txt + + - name: Publish packages + run: | + set -ex + dotnet nuget push -k "${{ secrets.BAGET_APIKEY }}" -s https://nuget.am-wd.de/v3/index.json --skip-duplicate /artifacts/*.nupkg diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 26ccfbe..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,189 +0,0 @@ -# The image should use the same version as the UnitTests are -image: mcr.microsoft.com/dotnet/sdk:10.0 - -variables: - TZ: Europe/Berlin - LANG: de - GIT_DEPTH: 0 - -stages: - - build - - test - - deploy - - - -build-debug: - stage: build - tags: - - docker - - lnx - - 64bit - rules: - - if: $CI_COMMIT_TAG == null - script: - - shopt -s globstar - - mkdir ./artifacts - - dotnet build -c Debug --nologo - - mv ./**/*.nupkg ./artifacts/ - - mv ./**/*.snupkg ./artifacts/ - artifacts: - paths: - - artifacts/*.nupkg - - artifacts/*.snupkg - expire_in: 7 days - -test-debug: - stage: test - dependencies: - - build-debug - tags: - - docker - - lnx - - 64bit - rules: - - if: $CI_COMMIT_TAG == null - coverage: /Branch coverage[\s\S].+%/ - before_script: - - dotnet tool install dotnet-reportgenerator-globaltool --tool-path /dotnet-tools - script: - - dotnet test -c Debug --nologo /p:CoverletOutputFormat=Cobertura - - /dotnet-tools/reportgenerator "-reports:${CI_PROJECT_DIR}/**/coverage.cobertura.xml" "-targetdir:/reports" "-reportType:TextSummary" - after_script: - - cat /reports/Summary.txt - artifacts: - when: always - reports: - coverage_report: - coverage_format: cobertura - path: ./**/coverage.cobertura.xml - -test-deploy: - stage: deploy - dependencies: - - build-debug - - test-debug - tags: - - docker - - lnx - - server - rules: - - if: $CI_COMMIT_TAG == null - script: - - dotnet nuget push -k $BAGET_APIKEY -s https://nuget.home.am-wd.de/v3/index.json artifacts/*.nupkg - - -build-release: - stage: build - tags: - - docker - - lnx - - 64bit - rules: - - if: $CI_COMMIT_TAG != null - script: - - shopt -s globstar - - mkdir ./artifacts - - dotnet build -c Release --nologo - - mv ./**/*.nupkg ./artifacts/ - - mv ./**/*.snupkg ./artifacts/ - artifacts: - paths: - - artifacts/*.nupkg - - artifacts/*.snupkg - expire_in: 1 days - -test-release: - stage: test - dependencies: - - build-release - tags: - - docker - - lnx - - 64bit - rules: - - if: $CI_COMMIT_TAG != null - coverage: /Branch coverage[\s\S].+%/ - before_script: - - dotnet tool install dotnet-reportgenerator-globaltool --tool-path /dotnet-tools - script: - - dotnet test -c Release --nologo /p:CoverletOutputFormat=Cobertura - - /dotnet-tools/reportgenerator "-reports:${CI_PROJECT_DIR}/**/coverage.cobertura.xml" "-targetdir:/reports" "-reportType:TextSummary" - after_script: - - cat /reports/Summary.txt - artifacts: - when: always - reports: - coverage_report: - coverage_format: cobertura - path: ./**/coverage.cobertura.xml - -deploy-common: - stage: deploy - dependencies: - - build-release - - test-release - tags: - - docker - - lnx - - server - rules: - - if: $CI_COMMIT_TAG =~ /^v[0-9.]+/ - script: - - dotnet nuget push -k $BAGET_APIKEY -s https://nuget.am-wd.de/v3/index.json --skip-duplicate artifacts/AMWD.Common.[0-9]*.nupkg - -deploy-aspnet: - stage: deploy - dependencies: - - build-release - - test-release - tags: - - docker - - lnx - - server - rules: - - if: $CI_COMMIT_TAG =~ /^asp\/v[0-9.]+/ - script: - - dotnet nuget push -k $BAGET_APIKEY -s https://nuget.am-wd.de/v3/index.json --skip-duplicate artifacts/AMWD.Common.AspNetCore.*.nupkg - -deploy-efcore: - stage: deploy - dependencies: - - build-release - - test-release - tags: - - docker - - lnx - - server - rules: - - if: $CI_COMMIT_TAG =~ /^efc\/v[0-9.]+/ - script: - - dotnet nuget push -k $BAGET_APIKEY -s https://nuget.am-wd.de/v3/index.json --skip-duplicate artifacts/AMWD.Common.EntityFrameworkCore.*.nupkg - -deploy-msgpack: - stage: deploy - dependencies: - - build-release - - test-release - tags: - - docker - - lnx - - server - rules: - - if: $CI_COMMIT_TAG =~ /^msgpack\/v[0-9.]+/ - script: - - dotnet nuget push -k $BAGET_APIKEY -s https://nuget.am-wd.de/v3/index.json --skip-duplicate artifacts/AMWD.Common.MessagePack.*.nupkg - -deploy-test: - stage: deploy - dependencies: - - build-release - - test-release - tags: - - docker - - lnx - - server - rules: - - if: $CI_COMMIT_TAG =~ /^test\/v[0-9.]+/ - script: - - dotnet nuget push -k $BAGET_APIKEY -s https://nuget.am-wd.de/v3/index.json --skip-duplicate artifacts/AMWD.Common.Test.*.nupkg diff --git a/CHANGELOG.md b/CHANGELOG.md index acd42ab..7269a36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - `UseDatabaseProvider()` throws `DatabaseProviderException` with more specific message content +- Migrated repository from Gitlab to Gitea ## v2.1.0, asp/v3.1.0, efc/v3.1.0, msgpack/v1.0.0, test/v2.2.0 - 2025-11-24 diff --git a/Common.sln b/Common.sln index 45e6c8c..02bf094 100644 --- a/Common.sln +++ b/Common.sln @@ -38,7 +38,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{86DE1B7C-3 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7196DA2B-D858-4B25-BC23-865175CFCDEC}" ProjectSection(SolutionItems) = preProject - .gitlab-ci.yml = .gitlab-ci.yml directory.build.props = directory.build.props EndProjectSection EndProject @@ -52,6 +51,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{93EC8B EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AMWD.Common.AspNetCore.Tests", "test\AMWD.Common.AspNetCore.Tests\AMWD.Common.AspNetCore.Tests.csproj", "{2CDA58C2-DE85-478D-9474-A937A20BECD1}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{2FCE653E-650C-445E-915D-09B48501A3C0}" + ProjectSection(SolutionItems) = preProject + .gitea\workflows\branch-build.yml = .gitea\workflows\branch-build.yml + .gitea\workflows\release-build.yml = .gitea\workflows\release-build.yml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -101,6 +106,7 @@ Global {7196DA2B-D858-4B25-BC23-865175CFCDEC} = {AFBF83AE-FE7D-48C1-B7E7-31BF3E17C6FB} {93EC8B16-7DEF-4E39-B590-E804DEF7C607} = {AFBF83AE-FE7D-48C1-B7E7-31BF3E17C6FB} {2CDA58C2-DE85-478D-9474-A937A20BECD1} = {E5DF156A-6C8B-4004-BA4C-A8DDE6FD3ECD} + {2FCE653E-650C-445E-915D-09B48501A3C0} = {7196DA2B-D858-4B25-BC23-865175CFCDEC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {961E8DF8-DDF5-4D10-A510-CE409E9962AC} diff --git a/README.md b/README.md index c583682..141a717 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ To save time, they are all packed to NuGet packages. | AMWD.Common.EntityFrameworkCore | ![https://nuget.am-wd.de/packages/amwd.common.entityframeworkcore/](https://services.am-wd.de/nuget.php?package=AMWD.Common.EntityFrameworkCore) | | AMWD.Common.MessagePack | ![https://nuget.am-wd.de/packages/amwd.common.messagepack/](https://services.am-wd.de/nuget.php?package=AMWD.Common.MessagePack) | | AMWD.Common.Test | ![https://nuget.am-wd.de/packages/amwd.common.test/](https://services.am-wd.de/nuget.php?package=AMWD.Common.Test) | -| CI / CD | ![https://git.am-wd.de/am-wd/common/-/pipelines](https://git.am-wd.de/am-wd/common/badges/main/pipeline.svg?style=flat-square) ![https://git.am-wd.de/am-wd/common/-/tree/main](https://git.am-wd.de/am-wd/common/badges/main/coverage.svg?style=flat-square) | ## Documentation diff --git a/src/AMWD.Common.AspNetCore/AMWD.Common.AspNetCore.csproj b/src/AMWD.Common.AspNetCore/AMWD.Common.AspNetCore.csproj index f1f3160..aa32191 100644 --- a/src/AMWD.Common.AspNetCore/AMWD.Common.AspNetCore.csproj +++ b/src/AMWD.Common.AspNetCore/AMWD.Common.AspNetCore.csproj @@ -11,6 +11,11 @@ AM.WD Common Library for ASP.NET Core + + + true + + diff --git a/src/AMWD.Common.EntityFrameworkCore/AMWD.Common.EntityFrameworkCore.csproj b/src/AMWD.Common.EntityFrameworkCore/AMWD.Common.EntityFrameworkCore.csproj index 5e06b66..9796750 100644 --- a/src/AMWD.Common.EntityFrameworkCore/AMWD.Common.EntityFrameworkCore.csproj +++ b/src/AMWD.Common.EntityFrameworkCore/AMWD.Common.EntityFrameworkCore.csproj @@ -11,6 +11,11 @@ AM.WD Common Library for EntityFramework Core + + + true + + diff --git a/src/AMWD.Common.MessagePack/AMWD.Common.MessagePack.csproj b/src/AMWD.Common.MessagePack/AMWD.Common.MessagePack.csproj index 3dc47eb..e7f35b0 100644 --- a/src/AMWD.Common.MessagePack/AMWD.Common.MessagePack.csproj +++ b/src/AMWD.Common.MessagePack/AMWD.Common.MessagePack.csproj @@ -11,6 +11,11 @@ AM.WD Common Library for MessagePack + + + true + + diff --git a/src/AMWD.Common.Test/AMWD.Common.Test.csproj b/src/AMWD.Common.Test/AMWD.Common.Test.csproj index d9e2cfb..323d707 100644 --- a/src/AMWD.Common.Test/AMWD.Common.Test.csproj +++ b/src/AMWD.Common.Test/AMWD.Common.Test.csproj @@ -11,6 +11,11 @@ AM.WD Common Library for Unit-Testing + + + true + + diff --git a/src/AMWD.Common/AMWD.Common.csproj b/src/AMWD.Common/AMWD.Common.csproj index 56dbc5b..2b2339d 100644 --- a/src/AMWD.Common/AMWD.Common.csproj +++ b/src/AMWD.Common/AMWD.Common.csproj @@ -10,6 +10,11 @@ AM.WD Common Library + + + true + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 8a0bd0b..f5c29d1 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,15 +1,14 @@ {semvertag:main}{!:-dev} + $(ContinuousIntegrationBuild) true - true true snupkg - false git - https://git.am-wd.de/am-wd/common.git + https://gitea.am-wd.de/am-wd/common.git true icon.png @@ -28,17 +27,23 @@ + + + true + + true + true - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive