build: Fix snap build (1.26) (#37686)

---------

Signed-off-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Lunny Xiao
2026-05-13 10:58:43 -07:00
committed by GitHub
parent 28729ef7e3
commit c7af094b0a
3 changed files with 86 additions and 28 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
set -e
if [ ! -f go.mod -o ! -d snap ]; then
echo "This script should be run from the root of the gitea repository"
exit 1
fi
if [ -z "$SNAPCRAFT_PART_INSTALL" ]; then
SNAPCRAFT_PART_INSTALL="./dist/snap"
echo "* using mock install path: $SNAPCRAFT_PART_INSTALL"
fi
command -v pnpm >/dev/null 2>&1 || npm install -g pnpm
TAGS="bindata sqlite sqlite_unlock_notify pam cert" make build
install -D gitea "${SNAPCRAFT_PART_INSTALL}/gitea"
cp -r options "${SNAPCRAFT_PART_INSTALL}/"