From 8e47c99ce17aae7797e6cbeb715944d6e01edd0c Mon Sep 17 00:00:00 2001 From: Neshura Date: Mon, 19 Jun 2023 20:01:15 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ae32283..fc52002 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,37 +18,42 @@ build: variables: IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH CACHING: - script: - echo "Compiling the code..." - cargo build -r - echo "Compile complete." - after_script: - echo JOB_ID=$CI_JOB_ID >> job.env - mkdir ./artifacts - cp /builds/Neshura/ascendance-of-a-bookworm-bot/target/release/ascendance-of-a-bookworm-bot ./artifacts/ - artifacts: paths: - ./artifacts/ reports: dotenv: job.env - rules: - !reference [.deploy, rules] -Tag Release: +upload: needs: - - job: build - artifacts: true + - job: build + artifacts: true + image: curlimages/curl:latest + stage: upload + script: + - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file artifacts/ascendance-of-a-bookworm-bot "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/linux/$CI_COMMIT_TAG/ascendance-of-a-bookworm-bot"' + rules: + - !reference [.deploy, rules] + + +Tag Release: stage: release image: registry.gitlab.com/gitlab-org/release-cli:latest rules: - - !reference [.deploy, rules] + - !reference [.deploy, rules] script: + - apk add curl - echo "running Release Job, attaching Artifact from Job $JOB_ID" - - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file artifacts/ascendance-of-a-bookworm-bot "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/linux/$CI_COMMIT_TAG/ascendance-of-a-bookworm-bot"' release: tag_name: '$CI_COMMIT_TAG' description: '$CI_COMMIT_TAG'