upgrade: RELEASE_NUMBERS is a variable with all known releases

the development branch is not build for v1.21 & v1.20 because they
pre-date the hard fork and near EOL
This commit is contained in:
Twenty Panda 2024-03-14 16:07:40 +07:00 committed by p
parent aa83694fd7
commit be86fe2e44
4 changed files with 23 additions and 13 deletions

View file

@ -12,18 +12,22 @@ DIR=$2
v=$(echo $version | sed -E -e 's/^([0-9]+\.[0-9]+).*/\1/')
read url ref semver < $SELF_DIR/sources/$v
rm -fr $DIR/src
if [[ "$ref" =~ ^refs/ ]] ; then
git clone --depth 1 $url $DIR/src
if ! test -d $DIR/src ; then
mkdir -p $DIR/src
cd $DIR/src
git fetch origin +$ref:$ref
git checkout -b $v $ref
git init
git remote add origin $url
else
git clone --depth 1 -b $ref $url $DIR/src
cd $DIR/src
fi
if ! [[ "$ref" =~ ^refs/ ]] ; then
ref=refs/heads/$ref
fi
git fetch --update-head-ok origin +$ref:$ref
git switch --force-create $v $ref
export TAGS="bindata sqlite sqlite_unlock_notify" FORGEJO_VERSION=$semver
make deps-backend backend
make generate forgejo
mv forgejo $DIR/forgejo-$version
cp -a forgejo $DIR/forgejo-$v-dev