1
0
Files
common/.gitlab-ci.yml

217 lines
5.0 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
build-branch:
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.Test/bin/Debug/*.nupkg ./artifacts/
- mv ./AMWD.Common.Test/bin/Debug/*.snupkg ./artifacts/
artifacts:
paths:
- artifacts/*.nupkg
- artifacts/*.snupkg
expire_in: 7 days
test-branch:
stage: test
tags:
- docker
- lnx
except:
- tags
coverage: '/Total[^|]*\|[^|]*\|\s*([0-9.%]+)/'
script:
- dotnet restore --no-cache --force
- dotnet test -c Debug --nologo --no-restore
build-main:
stage: build
tags:
- docker
- lnx
- amd64
only:
- tags
- changes:
- AMWD.Common/*
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/
artifacts:
paths:
- artifacts/*.nupkg
- artifacts/*.snupkg
expire_in: 1 day
build-main-asp:
stage: build
tags:
- docker
- lnx
- amd64
only:
- tags
- changes:
- AMWD.Common.AspNetCore/*
script:
- dotnet restore --no-cache --force
- dotnet build -c Release --nologo --no-restore --no-incremental
- mkdir ./artifacts
- mv ./AMWD.Common.AspNetCore/bin/Release/*.nupkg ./artifacts/
- mv ./AMWD.Common.AspNetCore/bin/Release/*.snupkg ./artifacts/
artifacts:
paths:
- artifacts/*.nupkg
- artifacts/*.snupkg
expire_in: 1 day
build-main-efc:
stage: build
tags:
- docker
- lnx
- amd64
only:
- tags
- changes:
- AMWD.Common.EntityFrameworkCore/*
script:
- dotnet restore --no-cache --force
- dotnet build -c Release --nologo --no-restore --no-incremental
- mkdir ./artifacts
- mv ./AMWD.Common.EntityFrameworkCore/bin/Release/*.nupkg ./artifacts/
- mv ./AMWD.Common.EntityFrameworkCore/bin/Release/*.snupkg ./artifacts/
artifacts:
paths:
- artifacts/*.nupkg
- artifacts/*.snupkg
expire_in: 1 day
build-main-test:
stage: build
tags:
- docker
- lnx
- amd64
only:
- tags
- changes:
- AMWD.Common.Test/*
script:
- dotnet restore --no-cache --force
- dotnet build -c Release --nologo --no-restore --no-incremental
- mkdir ./artifacts
- mv ./AMWD.Common.Test/bin/Release/*.nupkg ./artifacts/
- mv ./AMWD.Common.Test/bin/Release/*.snupkg ./artifacts/
artifacts:
paths:
- artifacts/*.nupkg
- artifacts/*.snupkg
expire_in: 1 day
test-main:
stage: test
tags:
- docker
- lnx
- amd64
only:
- tags
coverage: '/Total[^|]*\|[^|]*\|\s*([0-9.%]+)/'
script:
- dotnet restore --no-cache --force
- dotnet test -c Release --nologo --no-restore
deploy-main:
stage: deploy
dependencies:
- test-main
- build-main
tags:
- docker
- lnx
- amd64
only:
- tags
- changes:
- AMWD.Common/*
script:
- dotnet nuget push -k $BAGET_APIKEY -s https://nuget.am-wd.de/v3/index.json --skip-duplicate artifacts/AMWD.Common.*.nupkg
deploy-main-asp:
stage: deploy
dependencies:
- test-main
- build-main-asp
tags:
- docker
- lnx
- amd64
only:
- tags
- changes:
- AMWD.Common.AspNetCore/*
script:
- dotnet nuget push -k $BAGET_APIKEY -s https://nuget.am-wd.de/v3/index.json --skip-duplicate artifacts/AMWD.Common.AspNetCore.*.nupkg
deploy-main-efc:
stage: deploy
dependencies:
- test-main
- build-main-efc
tags:
- docker
- lnx
- amd64
only:
- tags
- changes:
- AMWD.Common.EntityFrameworkCore/*
script:
- dotnet nuget push -k $BAGET_APIKEY -s https://nuget.am-wd.de/v3/index.json --skip-duplicate artifacts/AMWD.Common.EntityFrameworkCore.*.nupkg
deploy-main-test:
stage: deploy
dependencies:
- test-main
- build-main-test
tags:
- docker
- lnx
- amd64
only:
- tags
- changes:
- AMWD.Common.Test/*
script:
- dotnet nuget push -k $BAGET_APIKEY -s https://nuget.am-wd.de/v3/index.json --skip-duplicate artifacts/AMWD.Common.Test.*.nupkg