Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix release script #14

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions scripts/roll_release.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@
set -o errexit

REPO="eth-cscs/DLA-Future-Fortran"
VERSION_MAJOR=$(sed -n 's/project(DLAFFortran VERSION \([0-9]\+\)\.[0-9]\+\.[0-9]\+ .*)/\1/p' CMakeLists.txt)
VERSION_MINOR=$(sed -n 's/project(DLAFFortran VERSION [0-9]\+\.\([0-9]\+\)\.[0-9]\+ .*)/\1/p' CMakeLists.txt)
VERSION_PATCH=$(sed -n 's/project(DLAFFortran VERSION [0-9]\+\.[0-9]\+\.\([0-9]\+\) .*)/\1/p' CMakeLists.txt)
VERSION_MAJOR=$(sed -n 's/project(DLAFFortran VERSION \([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*)/\1/p' CMakeLists.txt)
VERSION_MINOR=$(sed -n 's/project(DLAFFortran VERSION \([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*)/\2/p' CMakeLists.txt)
VERSION_PATCH=$(sed -n 's/project(DLAFFortran VERSION \([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*)/\3/p' CMakeLists.txt)
VERSION_FULL="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
VERSION_FULL_TAG="v${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
VERSION_TITLE="DLA-Future-Fortran ${VERSION_FULL}"
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
RELEASE_DATE=$(date '+%Y-%m-%d')

GREP_VERSION_FULL="$(echo ${VERSION_FULL} | sed s/\\./\\\\./g)"
GREP_VERSION_TITLE="$(echo ${VERSION_TITLE} | sed s/\\./\\\\./g)"

if ! which gh >/dev/null 2>&1; then
echo "GitHub CLI not installed on this system (see https://cli.github.com). Exiting."
exit 1
Expand Down Expand Up @@ -67,23 +70,23 @@ else
fi

printf "Checking that %s has an entry for %s... " "${changelog_path}" "${VERSION_FULL}"
if grep "## DLA-Future-Fortran ${VERSION_FULL}" "${changelog_path}"; then
if grep "## DLA-Future-Fortran ${GREP_VERSION_FULL}" "${changelog_path}"; then
echo "OK"
else
echo "ERROR"
sanity_errors=$((sanity_errors + 1))
fi

printf "Checking that %s has correct version for %s... " "${cff_path}" "${VERSION_FULL}"
if grep "^version: ${VERSION_FULL}" "${cff_path}"; then
if grep "^version: ${GREP_VERSION_FULL}" "${cff_path}"; then
echo "OK"
else
echo "ERROR"
sanity_errors=$((sanity_errors + 1))
fi

printf "Checking that %s has correct title for %s... " "${cff_path}" "${VERSION_FULL}"
if grep "^title: ${VERSION_TITLE}" "${cff_path}"; then
if grep "^title: ${GREP_VERSION_TITLE}" "${cff_path}"; then
echo "OK"
else
echo "ERROR"
Expand Down
Loading