sociallydistant/.gitlab-ci.yml

36 lines
1.5 KiB
YAML
Raw Normal View History

2024-07-21 20:39:45 -04:00
stages:
- legal
2024-07-21 20:39:45 -04:00
- build
- deploy
2024-07-21 20:39:45 -04:00
check_signoff:
stage: legal
script: >
2024-10-16 19:58:17 -04:00
set -x
COMMITTER_EMAIL=$(git log -1 --pretty=format:'%ae')
PROJECT_ID=$(curl --header "PRIVATE-TOKEN: $GITLAB_API_TOKEN" https://gitlab.com/api/v4/projects?search=$CI_PROJECT_PATH | jq '.[0].id')
MAINTAINER_CHECK=$(curl --header "PRIVATE-TOKEN: $GITLAB_API_TOKEN" "https://gitlab.com/api/v4/projects/$PROJECT_ID/members/all" | jq --arg EMAIL "$COMMITTER_EMAIL" '.[] | select(.email == $EMAIL and .access_level >= 40)')
2024-10-16 19:57:35 -04:00
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
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 build -c release src
publish_linux:
stage: deploy
image: cr.acidiclight.dev/docker-images/monogame-linux-build/dotnet-mgcb:latest
script:
- mkdir bin;
- 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 publish src/SociallyDistant -r linux-x64 -c release --self-contained -o bin/linux-x64;
artifacts:
name: socially-distant-linux-amd64-release
paths:
- bin/linux-x64