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"