image: mcr.microsoft.com/dotnet/sdk:8.0 variables: TZ: "Europe/Berlin" LANG: "de" 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 restore --no-cache --force - dotnet build -c Debug --nologo --no-restore --no-incremental - mv ./**/*.nupkg ./artifacts/ - mv ./**/*.snupkg ./artifacts/ artifacts: paths: - artifacts/*.nupkg - artifacts/*.snupkg expire_in: 1 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 deploy-debug: stage: deploy dependencies: - build-debug - test-debug tags: - docker - lnx - 64bit rules: - if: $CI_COMMIT_TAG == null script: - dotnet nuget push -k $BAGET_APIKEY -s https://nuget.am-wd.de/v3/index.json --skip-duplicate artifacts/*.nupkg build-release: stage: build tags: - docker - lnx - amd64 rules: - if: $CI_COMMIT_TAG != null script: - shopt -s globstar - mkdir ./artifacts - dotnet restore --no-cache --force - dotnet build -c Release --nologo --no-restore --no-incremental - mv ./**/*.nupkg ./artifacts/ - mv ./**/*.snupkg ./artifacts/ artifacts: paths: - artifacts/*.nupkg - artifacts/*.snupkg expire_in: 7 days test-release: stage: test dependencies: - build-release tags: - docker - lnx - amd64 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-release: stage: deploy dependencies: - build-release - test-release tags: - docker - lnx - 64bit rules: - if: $CI_COMMIT_TAG != null script: - dotnet nuget push -k $NUGET_APIKEY -s https://api.nuget.org/v3/index.json --skip-duplicate artifacts/*.nupkg