1+ #! /bin/bash
12# based on docs here: https://heigit.atlassian.net/wiki/spaces/OQT/pages/3474149/Releases
23# requires local installation of `gh`, the github CLI: https://cli.github.com
34
@@ -9,14 +10,14 @@ export NEW_VERSION=1.8.1
910
1011
1112# exit immediately if a command exits with a non-zero status
12- set -ex
13+ set -e
1314
1415
1516# get the directory of the current script
1617SCRIPT_DIR=" $( dirname " $0 " ) "
1718
1819# import user prompt
19- source " $SCRIPT_DIR /prompt_user_exit_or_continue .sh"
20+ source " $SCRIPT_DIR /functions .sh"
2021
2122
2223prompt_user " 👉 did you adjust the values for old and new versions in the release script?"
@@ -26,7 +27,7 @@ prompt_user "👉 do you run this script in an active python env? if not run 'po
2627
2728
2829# change to main directory
29- cd ..
30+ cd $SCRIPT_DIR / ..
3031
3132
3233# get latest version of main and create new branch
@@ -56,14 +57,14 @@ export NEW="__version__ = \"$NEW_VERSION\""
5657
5758
5859# might not work like this on linux
59- sed -i .bak " s/$OLD /$NEW /g" ohsome_quality_api/__init__.py
60+ run_sed " s/$OLD /$NEW /g" ohsome_quality_api/__init__.py
6061rm -rf ohsome_quality_api/__init__.py.bak
6162echo " ✅ updated __init__.py to $NEW_VERSION "
6263
6364
6465# insert new sub-headline for new release
6566prompt_user " 👉 update CHANGELOG.md?"
66- sed -i .bak " s/## Current Main/## Current Main \n\n## Release $NEW_VERSION /g" CHANGELOG.md
67+ run_sed " s/## Current Main/## Current Main\n\n## Release $NEW_VERSION /g" CHANGELOG.md
6768rm -rf CHANGELOG.md.bak
6869echo " ✅ updated CHANGELOG.md"
6970
@@ -108,4 +109,12 @@ echo "✅ created new github release and tag for version: $NEW_VERSION"
108109
109110
110111
111- echo " ⚠️ Please start the Jenkins tag build here: https://jenkins.heigit.org/job/OQAPI/view/tags/job/$NEW_VERSION /"
112+ JENKINS_URL=" https://jenkins.heigit.org/job/OQAPI/view/tags/job/${NEW_VERSION} /"
113+ echo " ⚠️ Please start the Jenkins tag build here: ${JENKINS_URL} "
114+ if [[ " $OSTYPE " == " linux-gnu" * ]]; then
115+ xdg-open " $JENKINS_URL "
116+ elif [[ " $OSTYPE " == " darwin" * ]]; then
117+ open " $JENKINS_URL "
118+ else
119+ printf " \nOS could not be detected. Please open report manually!\n"
120+ fi
0 commit comments