rjw-race-support-AsmodeusRex/.gitlab-ci.yml
2022-10-31 22:08:02 -07:00

40 lines
No EOL
1 KiB
YAML

stages:
- build
- upload
- release
variables:
PACKAGE_NAME: "${CI_PROJECT_ID}-${CI_COMMIT_TAG}"
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/release/${CI_COMMIT_TAG}"
build:
image: "rust:latest"
stage: build
rules:
- if: $CI_COMMIT_TAG
script:
- (cd generator; cargo run --locked)
- apt-get update && apt-get install -y zip
- zip -q9r build About Content LoadFolders.xml ReadMe.md changelog.txt
artifacts:
paths:
- build.zip
upload:
stage: upload
image: curlimages/curl:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file build.zip "${PACKAGE_REGISTRY_URL}/rjw-race-support.zip"
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
--assets-link "{\"name\":\"Download Build\",\"url\":\"${PACKAGE_REGISTRY_URL}/rjw-race-support.zip\"}"