Updated .gitlab-ci.yml

This commit is contained in:
Netkas 2023-08-16 16:56:58 -04:00
parent 56bfad6818
commit 7a1b337800
No known key found for this signature in database
GPG key ID: 5DAF58535614062B

View file

@ -37,18 +37,14 @@ publish:
script: script:
- | - |
if [[ ! -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="ncc-$CI_COMMIT_TAG"
PACKAGE_NAME=$CI_COMMIT_TAG
else else
# Otherwise, use the branch name as the package name PACKAGE_NAME="ncc-$CI_COMMIT_REF_NAME"
PACKAGE_NAME=$CI_COMMIT_REF_NAME
fi fi
mv build/*.tar.gz build/$PACKAGE_NAME.tar.gz
echo "Package Name: $PACKAGE_NAME"
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" \ curl --header "JOB-TOKEN: $CI_JOB_TOKEN" \
--upload-file build/*.tar.gz \ --upload-file build/$PACKAGE_NAME.tar.gz \
"https://$CI_SERVER_HOST/api/v4/projects/$CI_PROJECT_ID/packages/generic/$PACKAGE_NAME/$CI_PIPELINE_ID/file.tar.gz" "https://$CI_SERVER_HOST/api/v4/projects/$CI_PROJECT_ID/packages/generic/$PACKAGE_NAME/$CI_PIPELINE_ID/$PACKAGE_NAME.tar.gz"
only: only:
- branches - branches
- tags - tags