gitlab_release.sh 750 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/usr/bin/env bash

set -ve

source ci/release_helper.sh

# currently assuming that gitlab release
# will not be used for nightly releases
release_helper_init release

assets=()

for index in ${!LOCAL_FILE_NAMES[*]}; do
Bennet Bleßmann's avatar
Bennet Bleßmann committed
14 15 16 17 18
  entry="$(
    cat <<ENTRY
{
  "name":     "${UPLOAD_FILE_NAMES[$index]}",
  "url":      "${PACKAGE_REGISTRY_URL}/${UPLOAD_FILE_NAMES[$index]}",
19
  "filepath": "${UPLOAD_FILE_PATH[$index]}"
Bennet Bleßmann's avatar
Bennet Bleßmann committed
20 21 22 23
}
ENTRY
  )"
  assets+=(--assets-link "${entry}")
24 25
done

Bennet Bleßmann's avatar
Bennet Bleßmann committed
26
if [[ ${TEST_BUILD} == "yes" ]]; then
27 28 29 30 31 32
  tag="test-${CI_COMMIT_SHA}"
else
  tag="${CI_COMMIT_TAG}"
fi

release-cli create \
Bennet Bleßmann's avatar
Bennet Bleßmann committed
33
  --name "Release ${release_tag}" \
34
  --description "Created by the Release CI" \
Bennet Bleßmann's avatar
Bennet Bleßmann committed
35
  --tag-name "${release_tag}" \
36 37
  --ref "${CI_COMMIT_SHA}" \
  "${assets[@]}"