1
0
Files
common/.gitlab-ci.yml
2023-03-29 18:10:28 +02:00

116 lines
2.8 KiB
YAML

# The image has to use the same version as the .NET UnitTest project
image: mcr.microsoft.com/dotnet/sdk:6.0
variables:
TZ: "Europe/Berlin"
LANG: "de"
stages:
- build
- test
- deploy
debug-build:
stage: build
tags:
- docker
- lnx
except:
- tags
script:
- dotnet restore --no-cache --force
- dotnet build -c Debug --nologo --no-restore --no-incremental
- mkdir ./artifacts
- mv ./AMWD.Common/bin/Debug/*.nupkg ./artifacts/
- mv ./AMWD.Common/bin/Debug/*.snupkg ./artifacts/
- mv ./AMWD.Common.AspNetCore/bin/Debug/*.nupkg ./artifacts/
- mv ./AMWD.Common.AspNetCore/bin/Debug/*.snupkg ./artifacts/
- mv ./AMWD.Common.EntityFrameworkCore/bin/Debug/*.nupkg ./artifacts/
- mv ./AMWD.Common.EntityFrameworkCore/bin/Debug/*.snupkg ./artifacts/
- mv ./AMWD.Common.Moq/bin/Debug/*.nupkg ./artifacts/
- mv ./AMWD.Common.Moq/bin/Debug/*.snupkg ./artifacts/
artifacts:
paths:
- artifacts/*.nupkg
- artifacts/*.snupkg
expire_in: 7 days
debug-test:
stage: test
dependencies:
- debug-build
tags:
- docker
- lnx
except:
- tags
# branch-coverage
coverage: '/Total[^|]*\|[^|]*\|\s*([0-9.%]+)/'
script:
- dotnet restore --no-cache --force
- dotnet test -c Debug --nologo --no-restore
release-build:
stage: build
tags:
- docker
- lnx
- amd64
only:
- tags
script:
- dotnet restore --no-cache --force
- dotnet build -c Release --nologo --no-restore --no-incremental
- mkdir ./artifacts
- mv ./AMWD.Common/bin/Release/*.nupkg ./artifacts/
- mv ./AMWD.Common/bin/Release/*.snupkg ./artifacts/
- mv ./AMWD.Common.AspNetCore/bin/Release/*.nupkg ./artifacts/
- mv ./AMWD.Common.AspNetCore/bin/Release/*.snupkg ./artifacts/
- mv ./AMWD.Common.EntityFrameworkCore/bin/Release/*.nupkg ./artifacts/
- mv ./AMWD.Common.EntityFrameworkCore/bin/Release/*.snupkg ./artifacts/
- mv ./AMWD.Common.Moq/bin/Release/*.nupkg ./artifacts/
- mv ./AMWD.Common.Moq/bin/Release/*.snupkg ./artifacts/
artifacts:
paths:
- artifacts/*.nupkg
- artifacts/*.snupkg
expire_in: 1 day
release-test:
stage: test
dependencies:
- release-build
tags:
- docker
- lnx
- amd64
only:
- tags
# line-coverage
coverage: '/Total[^|]*\|\s*([0-9.%]+)/'
script:
- dotnet restore --no-cache --force
- dotnet test -c Release --nologo --no-restore
release-deploy:
stage: deploy
dependencies:
- release-build
- release-test
tags:
- docker
- lnx
- amd64
only:
- tags
script:
- dotnet nuget push -k $BAGET_APIKEY -s https://nuget.am-wd.de/v3/index.json --skip-duplicate artifacts/*.nupkg