Files
HopFrame/.gitlab-ci.yml
2025-02-28 12:29:26 +01:00

54 lines
1.3 KiB
YAML

image: mcr.microsoft.com/dotnet/sdk:9.0
stages:
- build
- test
- publish
- publish-help
build:
stage: build
script:
- dotnet restore
- dotnet build --configuration Release --no-restore
artifacts:
paths:
- "**/bin/Release"
expire_in: 10 minutes
test:
stage: test
script:
- dotnet test --verbosity normal
dependencies:
- build
publish:
stage: publish
script:
- export VERSION=$(echo $CI_COMMIT_TAG | sed 's/^v//')
- dotnet pack -c Release -o . /p:Version=$VERSION
- for nupkg in *.nupkg; do dotnet nuget push $nupkg -k ${NUGET_API_KEY} -s https://api.nuget.org/v3/index.json; done
only:
- tags
dependencies:
- build
- test
publish-help:
stage: publish-help
image: docker:latest
services:
- name: docker:dind
alias: docker
script:
- export VERSION=$(echo $CI_COMMIT_TAG | sed 's/^v//')
- docker login -u leon.hoppe -p ${CI_REGISTRY_PASSWORD} registry.leon-hoppe.de
- docker build -t registry.leon-hoppe.de/leon.hoppe/hopframe:$VERSION -t registry.leon-hoppe.de/leon.hoppe/hopframe:latest .
- docker push registry.leon-hoppe.de/leon.hoppe/hopframe:$VERSION
- docker push registry.leon-hoppe.de/leon.hoppe/hopframe:latest
only:
- tags
dependencies:
- publish