2023-12-16 10:24:55 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
end_to_end=$1
|
|
|
|
end_to_end_pr=$2
|
|
|
|
forgejo=$3
|
2024-03-05 11:44:26 -05:00
|
|
|
forgejo_pr_or_ref=$4
|
|
|
|
|
|
|
|
cd $forgejo
|
|
|
|
full_version=$(make show-version-full)
|
2024-03-20 12:32:06 -04:00
|
|
|
minor_version=$(make show-version-minor)
|
2023-12-16 10:24:55 -05:00
|
|
|
|
|
|
|
cd $end_to_end
|
2024-03-20 12:32:06 -04:00
|
|
|
|
2024-08-08 11:53:12 -04:00
|
|
|
if ! test -f forgejo/sources/$minor_version; then
|
|
|
|
echo "FAIL: forgejo/sources/$minor_version does not exist in the end-to-end repository"
|
|
|
|
false
|
2024-03-20 12:32:06 -04:00
|
|
|
fi
|
|
|
|
|
2024-08-08 11:53:12 -04:00
|
|
|
echo -n $minor_version >forgejo/build-from-sources
|
|
|
|
date >last-upgrade
|
2023-12-16 10:24:55 -05:00
|
|
|
|
2024-08-08 11:53:12 -04:00
|
|
|
if test -f "$forgejo_pr_or_ref"; then
|
|
|
|
forgejo_pr=$forgejo_pr_or_ref
|
|
|
|
head_url=$(jq --raw-output .head.repo.html_url <$forgejo_pr)
|
|
|
|
test "$head_url" != null
|
|
|
|
branch=$(jq --raw-output .head.ref <$forgejo_pr)
|
|
|
|
test "$branch" != null
|
|
|
|
echo $head_url $branch $full_version >forgejo/sources/$minor_version
|
2024-03-05 11:44:26 -05:00
|
|
|
else
|
2024-08-08 11:53:12 -04:00
|
|
|
forgejo_ref=$forgejo_pr_or_ref
|
|
|
|
echo $GITHUB_SERVER_URL/$GITHUB_REPOSITORY ${forgejo_ref#refs/heads/} $full_version >forgejo/sources/$minor_version
|
2024-03-05 11:44:26 -05:00
|
|
|
fi
|