me-web? skeleton: Avalonia 12 app, server, packaging and CI
Build / Desktop, server and tools (push) Successful in 1m7s

The first screen (online or not, a Check button, every language with a
draft notice), the desktop and Android heads, the server's /api/info and
/api/ip, a release tool that builds deb, rpm, a Windows exe, macOS zips,
a signed APK and the server, and the Gitea workflows that run it. Rules
adapted from passolo; AGPL-3.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
This commit is contained in:
thepraandClaude Opus 5.5 committed 2026-10-15 01:14:44 +02:00
commit 7589121846
76 files changed
+3082

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
set -e
if [ -z "$MEWEB_KEYSTORE_B64" ] || [ -z "$MEWEB_KEYSTORE_PASS" ]; then
echo "::error::the repository secrets MEWEB_KEYSTORE_B64 and MEWEB_KEYSTORE_PASS are not set"
exit 1
fi
MEWEB_KEYSTORE="${RUNNER_TEMP:-/tmp}/meweb-$$.keystore"
export MEWEB_KEYSTORE MEWEB_KEYSTORE_PASS
trap 'rm -f "$MEWEB_KEYSTORE"' EXIT
umask 077
printf '%s' "$MEWEB_KEYSTORE_B64" | base64 -d > "$MEWEB_KEYSTORE"
unset MEWEB_KEYSTORE_B64
tools/release.sh android --commit "$COMMIT"
+41
View File
@@ -0,0 +1,41 @@
#!/bin/sh
set -eu
archive=$1
app=/var/www/meweb.arasaka.software
backups=/var/backups/meweb.arasaka.software
health=http://127.0.0.1:5480/api/info
stamp=$(date -u +%Y%m%d%H%M%S)
stage=$(mktemp -d)
trap 'rm -rf "$stage"' EXIT
tar -xzf "$archive" -C "$stage"
test -x "$stage/MeWeb.Server"
snapshot=""
if [ -x "$app/MeWeb.Server" ]; then
snapshot="$backups/meweb-$stamp"
rsync -a "$app/" "$snapshot/"
ls -1dt "$backups"/meweb-* 2>/dev/null | tail -n +4 | xargs -r rm -rf
fi
sudo systemctl stop meweb || true
rsync -a --delete "$stage/" "$app/"
sudo systemctl start meweb
for attempt in $(seq 1 30); do
if curl -fsS "$health" | grep -q "\"commit\":\"$COMMIT\""; then
echo "deployed $COMMIT: $(curl -fsS "$health")"
exit 0
fi
sleep 1
done
echo "::error::the new server did not answer with commit $COMMIT"
sudo systemctl status meweb --no-pager | tail -20 || true
if [ -n "$snapshot" ]; then
sudo systemctl stop meweb || true
rsync -a --delete "$snapshot/" "$app/"
sudo systemctl start meweb
echo "rolled back to $snapshot"
fi
exit 1
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
set -e
version=$(sed -n 's:.*<Version>\(.*\)</Version>.*:\1:p' Directory.Build.props | head -n 1)
if [ "$GITHUB_REF_TYPE" = "tag" ] && [ "$GITHUB_REF_NAME" != "v$version" ]; then
echo "::error::tag $GITHUB_REF_NAME does not match Version $version in Directory.Build.props"
exit 1
fi
echo "VERSION=$version" >> "$GITHUB_ENV"
echo "COMMIT=$(echo "$GITHUB_SHA" | cut -c1-8)" >> "$GITHUB_ENV"
keep="$HOME/.cache/meweb"
for dir in tools/cache tools/jdk tools/packaging tools/android-sdk; do
mkdir -p "$keep/$dir"
rm -rf "$dir"
ln -s "$keep/$dir" "$dir"
done
rm -rf releases dist
echo "version $version, tools cached in $keep"
+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
set -eu
tag=$1; shift
api="${GITHUB_SERVER_URL:-https://git.thepra.dev}/api/v1/repos/$GITHUB_REPOSITORY"
call() { printf 'header = "Authorization: token %s"\n' "$RELEASE_TOKEN" | curl -K - -fsS "$@"; }
json() { python3 -c "import json,sys; d=json.load(sys.stdin); print($1)"; }
if id=$(call "$api/releases/tags/$tag" 2>/dev/null | json 'd["id"]'); then
echo "release $tag exists (id $id)"
else
body=$(python3 -c 'import json,sys; print(json.dumps({"tag_name": sys.argv[1], "name": sys.argv[1], "draft": False, "prerelease": sys.argv[1].startswith("v0.")}))' "$tag")
id=$(call -X POST -H 'Content-Type: application/json' -d "$body" "$api/releases" | json 'd["id"]')
echo "created release $tag (id $id)"
fi
for file in "$@"; do
name=$(basename "$file")
call "$api/releases/$id/assets" | python3 -c 'import json,sys; [print(a["id"]) for a in json.load(sys.stdin) if a["name"] == sys.argv[1]]' "$name" | while read -r old; do
call -o /dev/null -X DELETE "$api/releases/$id/assets/$old"
done
call -o /dev/null -F "attachment=@$file" "$api/releases/$id/assets?name=$name"
echo "attached $name ($(du -h "$file" | cut -f1))"
done