rjw-race-support-AsmodeusRex/.gitlab-ci.yml

42 lines
1.2 KiB
YAML
Raw Normal View History

2022-10-30 18:48:14 +00:00
stages:
- build
- upload
- release
variables:
PACKAGE_NAME: "${CI_PROJECT_ID}-${CI_COMMIT_TAG}"
2022-10-31 20:57:36 +00:00
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/release/${CI_COMMIT_TAG}"
2022-10-30 18:48:14 +00:00
build:
2022-10-30 19:50:30 +00:00
image: "rust:latest"
2022-10-30 18:48:14 +00:00
stage: build
rules:
- if: $CI_COMMIT_TAG
script:
- (cd generator; cargo run --locked)
2022-11-01 17:40:48 +00:00
- echo ${CI_COMMIT_TAG} > VERSION
2022-10-31 17:21:16 +00:00
- apt-get update && apt-get install -y zip
2022-11-01 17:40:48 +00:00
- zip -q9r build About Content LoadFolders.xml ReadMe.md changelog.txt VERSION
2022-10-30 18:48:14 +00:00
artifacts:
paths:
- build.zip
upload:
stage: upload
image: curlimages/curl:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
2022-10-31 22:46:39 +00:00
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file build.zip "${PACKAGE_REGISTRY_URL}/rjw-race-support.zip"
2022-10-30 18:48:14 +00:00
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 \
2022-11-01 17:40:48 +00:00
--assets-link "{\"name\":\"Download Build\",\"url\":\"${PACKAGE_REGISTRY_URL}/rjw-race-support.zip\",\"filepath\":\"/rjw-race-support.zip\"}" \
--description "Changelog goes here"