Skip to content
Snippets Groups Projects
Commit 4b114abc authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Adde create_release_from_gitlab_ci.sh and updated create_github_release CI...

Adde create_release_from_gitlab_ci.sh and updated create_github_release CI job. Updated version info.

Signed-off-by: default avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent b3a04637
Branches
Tags v0.9.15
No related merge requests found
Pipeline #8227 failed
#!/usr/bin/env bash
# NOTE: The environment variables are present during the CI job.
URL_RELEASES=https://api.github.com/repos/$GITHUB_USER/$GITHUB_REPONAME/releases
# create the release
API_JSON=$(printf '{"tag_name":"%s",
"target_commitish":"master",
"name":"%s",
"body":"",
"draft":false,
"prerelease":false}' $CI_COMMIT_TAG $CI_COMMIT_TAG)
AUTH_HEADER="Authorization: token $GITHUB_RELEASE_TOKEN"
curl $URL_RELEASES --data "$API_JSON" -H "$AUTH_HEADER"
# get latest release tag name
LATEST_RELEASE=$(curl -s "$URL_RELEASES"/latest | grep -oP '"tag_name": "\K(.*)(?=")')
if [ "$LATEST_RELEASE" != "$CI_COMMIT_TAG" ]; then
echo "Error: Could not properly create the release!" 1>&2
exit 1
fi
......@@ -2,11 +2,6 @@ before_script:
- git lfs pull
# Advise GitLab that these environment vars should be loaded from the Variables config.
variables:
GITHUB_RELEASE_TOKEN: SECURE
stages:
- test
- deploy
......@@ -134,15 +129,7 @@ create_github_release:
dependencies:
- test_arosics
script:
- API_JSON=$(printf '{"tag_name":"%s",
"target_commitish":"master",
"name":"%s",
"body":"",
"draft":false,
"prerelease":false}' \
$CI_COMMIT_TAG $CI_COMMIT_TAG)
- 'AUTH_HEADER="Authorization: token $GITHUB_RELEASE_TOKEN"' # quotes avoid YAML syntax error caused by ':'
- curl https://api.github.com/repos/GFZ/arosics/releases --data "$API_JSON" -H "$AUTH_HEADER"
- bash create_release_from_gitlab_ci.sh # uses environment variables set in the UI
only:
- /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
except:
......
......@@ -22,5 +22,5 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
__version__ = '0.9.14'
__versionalias__ = '2020-04-08_03'
__version__ = '0.9.15'
__versionalias__ = '2020-04-09_01'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment