Support downloading binaries for experimental releases

This is a minor enhancement that allows the forgejo-bin package to match
the others, specifically when building a pull request for an official
Forgejo version that hasn't yet been released.
This commit is contained in:
crystal 2024-05-01 19:57:10 -06:00
parent f985489b70
commit 2cbc8603ba
No known key found for this signature in database
GPG key ID: 1122054731F7CC43

View file

@ -95,7 +95,18 @@ case "$1" in
if [ ! $CI_COMMIT_TAG_RESOLVE ] ; then if [ ! $CI_COMMIT_TAG_RESOLVE ] ; then
echo "Failed to resolve exact tag! Getting as close as we can..." echo "Failed to resolve exact tag! Getting as close as we can..."
git describe --tags HEAD git describe --tags HEAD
CI_COMMIT_TAG_RESOLVE=$(git describe --tags HEAD --abbrev=0) FORGEJO_CLOSEST_TAG=$(git describe --tags HEAD --abbrev=0)
echo "Looking for experimental tag..."
EXPERIMENTAL_REPO="forgejo-experimental/forgejo"
git remote add experimental $CI_VERIFY_API/$EXPERIMENTAL_REPO
git fetch experimental --tags
CI_COMMIT_TAG_RESOLVE=$(git tag --points-at HEAD)
if [ $CI_COMMIT_TAG_RESOLVE ] ; then
CI_VERIFY_REPO=$EXPERIMENTAL_REPO
FORGEJO_CLOSEST_TAG=$CI_COMMIT_TAG_RESOLVE
echo "Found it! Using experimental tag and downloading binary from $CI_VERIFY_REPO"
fi
CI_COMMIT_TAG_RESOLVE=$FORGEJO_CLOSEST_TAG
echo "Closest existing tag: $CI_COMMIT_TAG_RESOLVE" echo "Closest existing tag: $CI_COMMIT_TAG_RESOLVE"
if [ "$CI_COMMIT_TAG_RESOLVE" != "${CI_COMMIT_TAG_RESOLVE%"-dev"}" ] || [ ! "$CI_COMMIT_TAG_RESOLVE" ] ; then if [ "$CI_COMMIT_TAG_RESOLVE" != "${CI_COMMIT_TAG_RESOLVE%"-dev"}" ] || [ ! "$CI_COMMIT_TAG_RESOLVE" ] ; then
if [ $PR_MODE ] ; then if [ $PR_MODE ] ; then