sociallydistant/.gitlab-ci.yml

45 lines
1.7 KiB
YAML

stages:
- legal
- build
- deploy
check_signoff:
stage: legal
image: cr.acidiclight.dev/docker-images/tinygit/tinygit:latest
script: |
COMMITTER_EMAIL=$(git log -1 --pretty=format:'%ae')
MAINTAINER_CHECK=$(curl -s --header "PRIVATE-TOKEN: $CI_PRIVILEGED_ACCESS_TOKEN" "https://gitlab.acidiclight.dev/api/v4/projects/$CI_PROJECT_ID/members/all" | jq --arg EMAIL "$COMMITTER_EMAIL" '.[] | select(.email == $EMAIL and .access_level >= 40)')
if [ -z "$MAINTAINER_CHECK" ]; then echo $CI_COMMIT_MESSAGE | grep "Signed-off-by: $CI_COMMIT_AUTHOR"; fi
# Makes sure the base game compiles.
build_base:
stage: build
image: cr.acidiclight.dev/docker-images/monogame-linux-build/dotnet-mgcb:latest
before_script:
- if (dotnet nuget list source | grep gitlab); then dotnet nuget remove source gitlab; fi
- dotnet nuget add source -n gitlab https://gitlab.acidiclight.dev/api/v4/projects/13/packages/nuget/index.json
- mkdir bin
script:
- dotnet build -c release src
after_script:
- dotnet publish src/SociallyDistant -r linux-x64 -c release --self-contained -o bin/linux-x64;
artifacts:
name: "socially-distant-linux-amd64-$CI_COMMIT_REF_SLUG"
paths:
- bin/linux-x64
update_online_manual:
stage: deploy
image: cr.acidiclight.dev/docker-images/monogame-linux-build/dotnet-mgcb:latest
before_script:
- if (dotnet nuget list source | grep gitlab); then dotnet nuget remove source gitlab; fi
- dotnet nuget add source -n gitlab https://gitlab.acidiclight.dev/api/v4/projects/13/packages/nuget/index.json
- dotnet tool update -g docfx
script:
- export PATH="$PATH:$HOME/.dotnet/tools"
- docfx
artifacts:
paths:
- public
only:
- master