[squash] use actions for pr tests

This commit is contained in:
crystal 2024-04-27 20:52:24 -06:00
parent 08f545c366
commit 1a8f2ec431
No known key found for this signature in database
GPG key ID: 1122054731F7CC43
2 changed files with 16 additions and 2 deletions

View file

@ -77,10 +77,15 @@ case "$1" in
exit 255
;;
"download-binary")
if [ "$GITHUB_BASE_REF" ] ; then
echo "forgejo actions pull request mode"
echo "making sure you didn't break binary builds..."
PR_MODE=true
fi
if [ "$GITHUB_REF_TYPE" = "tag" ] ; then
echo "INFO: Forgejo Actions mode!"
CI_COMMIT_TAG="$GITHUB_REF_NAME"
elif [ "$GITHUB_REF_TYPE" = "branch" ] ; then
elif [ "$GITHUB_REF_TYPE" = "branch" ] || [ $PR_MODE ] ; then
echo "WARNING: Not building a tag! Simulating it..."
echo "(forgejo actions mode)"
echo "(this will test the binary packaging without cutting a tag in the package)"
@ -92,6 +97,15 @@ case "$1" in
git describe --tags HEAD
CI_COMMIT_TAG_RESOLVE=$(git describe --tags HEAD --abbrev=0)
echo "Closest existing tag: $CI_COMMIT_TAG_RESOLVE"
if [ "$CI_COMMIT_TAG_RESOLVE" = *"-dev" ] ; then
if [ $PR_MODE ] ; then
echo "I can't figure out which release version of Forgejo to build your PR against."
echo "Whatever you're trying to do is not yet implemented."
exit 97
fi
echo "err! building dev version- skipping binary dl"
CI_COMMIT_TAG_RESOLVE=
fi
fi
cd ..
echo "Proceeding with resolved tag: $CI_COMMIT_TAG_RESOLVE"

View file

@ -1,4 +1,4 @@
on: [push]
on: [push, pull_request]
jobs:
build-forgejo-deb:
runs-on: bullseye