From eb0ae32b71765c58cbc9e100f2b9d4226a910ccb Mon Sep 17 00:00:00 2001 From: Netkas Date: Wed, 16 Aug 2023 15:09:24 -0400 Subject: [PATCH] Updated .gitlab-ci.yml --- .gitlab-ci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dd4760d..6c34565 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,14 +41,16 @@ publish: stage: publish script: - | - if [[ "$CI_COMMIT_REF_NAME" == "master" || "$CI_COMMIT_REF_NAME" == "dev" ]]; then - PACKAGE_NAME=$CI_COMMIT_REF_NAME - elif [[ ! -z "$CI_COMMIT_TAG" ]]; then + if [[ ! -z "$CI_COMMIT_TAG" ]]; then + # If this is a tagged commit, use the tag name as package name PACKAGE_NAME=$CI_COMMIT_TAG else - PACKAGE_NAME=feature/$CI_COMMIT_REF_NAME + # Otherwise, use the branch name as the package name + PACKAGE_NAME=$CI_COMMIT_REF_NAME fi - + + echo "Package Name: $PACKAGE_NAME" + curl --header "JOB-TOKEN: $CI_JOB_TOKEN" \ --upload-file build/*.tar.gz \ "https://$CI_SERVER_HOST/api/v4/projects/$CI_PROJECT_ID/packages/generic/$PACKAGE_NAME/$CI_PIPELINE_ID/file.tar.gz"