From a77bf9342b68a3a978b32531cab7170e0a4dc82b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Wed, 30 Jun 2021 22:13:24 +0200 Subject: [PATCH] Add beta support to ghactions workflow --- .github/build.sh | 11 ++++++++++- .github/get-type.py | 8 ++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/build.sh b/.github/build.sh index 139354661..17598c1a6 100755 --- a/.github/build.sh +++ b/.github/build.sh @@ -76,6 +76,14 @@ fi if [ $PLATFORM_SHORT == "win" ]; then bin_suffix=$bin_suffix.exe fi +stable_or_beta="n" +if [ "$RELTYPE" == "beta" ]; then + other_flags+=$'\t-Dbeta=true' + stable_or_beta="y" +fi +if [ "$RELTYPE" == "stable" ]; then + stable_or_beta="y" +fi if [ "$RELTYPE" == "snapshot" ]; then other_flags+=$'\t-Dsnapshot=true\t-Dsnapshot_id=' other_flags+=`echo $RELNAME | cut -d '-' -f 2` # $RELNAME is snapshot-X @@ -84,7 +92,8 @@ if [ "$RELTYPE" == "snapshot" ] && [ "$MOD_ID" != "0" ]; then >&2 echo "mods and snapshots do not mix" exit 1 fi -if [ "$RELTYPE" == "stable" ] && [ "$MOD_ID" != "0" ]; then +if [ "$stable_or_beta" == "y" ] && [ "$MOD_ID" != "0" ]; then + # mods and snapshots both check their snapshot_id against whatever version starcatcher.us/TPT has other_flags+=$'\t-Dsnapshot_id=' other_flags+=`echo $RELNAME | cut -d '.' -f 3` # $RELNAME is vX.Y.Z fi diff --git a/.github/get-type.py b/.github/get-type.py index 451a8011d..410fe80a1 100644 --- a/.github/get-type.py +++ b/.github/get-type.py @@ -3,11 +3,15 @@ import sys ref = sys.argv[1] -match_stable = re.match(r'refs/tags/v([0-9]+)\.([0-9]+)\.([0-9]+)', ref) -match_snapshot = re.match(r'refs/tags/snapshot-([0-9]+)', ref) +match_stable = re.fullmatch(r'refs/tags/v([0-9]+)\.([0-9]+)\.([0-9]+)', ref) +match_beta = re.fullmatch(r'refs/tags/v([0-9]+)\.([0-9]+)\.([0-9]+)b', ref) +match_snapshot = re.fullmatch(r'refs/tags/snapshot-([0-9]+)', ref) if match_stable: print('::set-output name=TYPE::stable') print('::set-output name=NAME::v%s.%s.%s' % (match_stable.group(1), match_stable.group(2), match_stable.group(3))) +elif match_beta: + print('::set-output name=TYPE::beta') + print('::set-output name=NAME::v%s.%s.%sb' % (match_beta.group(1), match_beta.group(2), match_beta.group(3))) elif match_snapshot: print('::set-output name=TYPE::snapshot') print('::set-output name=NAME::snapshot-%s' % match_snapshot.group(1))