diff --git a/.gitea/workflows/branch-build.yml b/.gitea/workflows/branch-build.yml new file mode 100644 index 0000000..9e8a9a6 --- /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 + 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 + shell: bash + run: | + set -ex + shopt -s globstar + mkdir /artifacts + dotnet build -c ${CONFIGURATION} --no-restore --nologo + mv ./**/*.nupkg /artifacts/ + mv ./**/*.snupkg /artifacts/ + + - 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 + env: + BAGET_APIKEY: ${{ secrets.BAGET_APIKEY }} + run: | + set -ex + dotnet nuget push -k ${BAGET_APIKEY} -s https://nuget.am-wd.de/v3/index.json --skip-duplicate /artifacts/*.nupkg diff --git a/.gitea/workflows/core-build.yml b/.gitea/workflows/core-build.yml new file mode 100644 index 0000000..ac70ff1 --- /dev/null +++ b/.gitea/workflows/core-build.yml @@ -0,0 +1,69 @@ +name: Core Build + +on: + push: + tags: + - 'v*' + +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 + + - name: Build solution + shell: bash + run: | + set -ex + shopt -s globstar + mkdir /artifacts + dotnet build -c ${CONFIGURATION} --no-restore --nologo src/Cloudflare/Cloudflare.csproj + mv ./src/Cloudflare/**/*.nupkg /artifacts/ + mv ./src/Cloudflare/**/*.snupkg /artifacts/ + + - name: Test solution + run: | + set -ex + dotnet test -c ${CONFIGURATION} --no-build --nologo /p:CoverletOutputFormat=Cobertura test/Cloudflare.Tests/Cloudflare.Tests.csproj + /dotnet-tools/reportgenerator "-reports:${{ gitea.workspace }}/**/coverage.cobertura.xml" "-targetdir:/reports" "-reportType:TextSummary" + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: artifacts + path: | + /reports/Summary.txt + + - name: Publish packages + env: + NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }} + run: | + set -ex + dotnet nuget push -k ${NUGET_APIKEY} -s https://api.nuget.org/v3/index.json --skip-duplicate /artifacts/*.nupkg diff --git a/.gitea/workflows/docs-build.yml b/.gitea/workflows/docs-build.yml new file mode 100644 index 0000000..6026f02 --- /dev/null +++ b/.gitea/workflows/docs-build.yml @@ -0,0 +1,71 @@ +name: Documentation Build + +on: + push: + tags: + - '**' + +env: + TZ: 'Europe/Berlin' + LANG: 'de' + CONFIGURATION: 'Release' + GITEA_SERVER_URL: ${{ gitea.server_url }} + +jobs: + build-deploy: + runs-on: server-runner + 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 + shell: bash + run: | + set -ex + shopt -s globstar + mkdir /artifacts + dotnet build -c ${CONFIGURATION} --no-restore --nologo + + - 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 documentation + env: + DOCFX_SOURCE_REPOSITORY_URL: 'https://github.com/AM-WD/cloudflare-api' + run: | + set -ex + /dotnet-tools/docfx metadata docs/docfx.json + /dotnet-tools/docfx build docs/docfx.json + tar -C "${{ gitea.workspace }}/docs/_site" -czf "/artifacts/docs.tar.gz" . + curl -sSL --no-progress-meter --user "${{ secrets.DOCS_DEPLOY_USER }}:${{ secrets.DOCS_DEPLOY_PASS }}" -F docs=cloudflare -F dump=@/artifacts/docs.tar.gz "${{ vars.DOCS_DEPLOY_URL }}" + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: cloudflare-docs + path: | + ${{ gitea.workspace }}/docs/_site diff --git a/.gitea/workflows/extensions-build.yml b/.gitea/workflows/extensions-build.yml new file mode 100644 index 0000000..1d472f2 --- /dev/null +++ b/.gitea/workflows/extensions-build.yml @@ -0,0 +1,70 @@ +name: Extensions Build + +on: + push: + tags: + - 'dns/v*' + - 'zones/v*' + +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 + + - name: Build solution + shell: bash + run: | + set -ex + shopt -s globstar + mkdir /artifacts + dotnet build -c ${CONFIGURATION} --no-restore --nologo + mv ./src/Extensions/**/*.nupkg /artifacts/ + mv ./src/Extensions/**/*.snupkg /artifacts/ + + - 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" + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: artifacts + path: | + /reports/Summary.txt + + - name: Publish packages + env: + NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }} + run: | + set -ex + dotnet nuget push -k ${NUGET_APIKEY} -s https://api.nuget.org/v3/index.json --skip-duplicate /artifacts/*.nupkg diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cf4e5f..36fa94a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated tests to .NET 10 - Updated solution to VS 2026 +- Migrated main repository from Gitlab to Gitea (CI/CD) ## v0.1.1, dns/v0.2.0, zones/v0.1.1 - 2025-11-06 diff --git a/README.md b/README.md index 5a1e402..ce21d7e 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,6 @@ This package contains the feature set of the _Domain/Zone Management_ section of Published under [MIT License] (see [choose a license]) -[![Buy me a Coffee](https://shields.am-wd.de/badge/PayPal-Buy_me_a_Coffee-yellow?style=flat&logo=paypal)](https://link.am-wd.de/donate) - [Cloudflare]: src/Cloudflare/README.md diff --git a/cloudflare-api.slnx b/cloudflare-api.slnx index a2ae94a..e6f9e75 100644 --- a/cloudflare-api.slnx +++ b/cloudflare-api.slnx @@ -1,9 +1,14 @@ - + - + + + + + + diff --git a/src/Cloudflare/Cloudflare.csproj b/src/Cloudflare/Cloudflare.csproj index 79e6837..22947ff 100644 --- a/src/Cloudflare/Cloudflare.csproj +++ b/src/Cloudflare/Cloudflare.csproj @@ -16,8 +16,8 @@ ../../cloudflare-api.snk - - + + true diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 302f2dc..efa0044 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,6 +2,7 @@ enable {semvertag:main}{!:-dev} + $(ContinuousIntegrationBuild) true false @@ -18,7 +19,6 @@ true snupkg - false Modular Cloudflare API implementation in .NET AM.WD @@ -26,20 +26,26 @@ © {copyright:2025-} AM.WD - + true + true - - - + + + true + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Extensions/Cloudflare.Dns/Cloudflare.Dns.csproj b/src/Extensions/Cloudflare.Dns/Cloudflare.Dns.csproj index efd85b3..a6cfce2 100644 --- a/src/Extensions/Cloudflare.Dns/Cloudflare.Dns.csproj +++ b/src/Extensions/Cloudflare.Dns/Cloudflare.Dns.csproj @@ -15,7 +15,7 @@ - + true diff --git a/src/Extensions/Cloudflare.Zones/Cloudflare.Zones.csproj b/src/Extensions/Cloudflare.Zones/Cloudflare.Zones.csproj index 5c18bd3..7845966 100644 --- a/src/Extensions/Cloudflare.Zones/Cloudflare.Zones.csproj +++ b/src/Extensions/Cloudflare.Zones/Cloudflare.Zones.csproj @@ -15,7 +15,7 @@ - + true