aboutsummaryrefslogtreecommitdiff
path: root/ci/release.sh
diff options
context:
space:
mode:
authorLena <lena@omega>2026-01-01 00:00:00 +0000
committerLena <lena@omega>2026-01-01 00:00:00 +0000
commit7e04941bccb2683f8a6e3ee38a99c50129234dd1 (patch)
tree471227fa437291e7a6b499e3de6c106c54eaf311 /ci/release.sh
downloadrsend-7e04941bccb2683f8a6e3ee38a99c50129234dd1.tar.gz
rsend: push phone folders to a home SSH host over rsync
A small Android app for one-way folder backup, a KISS alternative to Syncthing. It bundles rsync (built from pinned source via the NDK) and a pure-Go SSH transport, both shipped in the APK as lib*.so and run from the native library directory. rsend pins the host key, stores the ed25519 identity Keystore-encrypted, pushes each folder additively or as a mirror, and runs on demand or on a WiFi-only schedule. The build is self-contained and reproducible: make setup provisions the toolchain, make builds rsync, rsh, and the APK.
Diffstat (limited to 'ci/release.sh')
-rwxr-xr-xci/release.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/ci/release.sh b/ci/release.sh
new file mode 100755
index 0000000..cec2b42
--- /dev/null
+++ b/ci/release.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+# Publish a signed release APK to a Codeberg (Forgejo) release. Run on a tag,
+# after ci/build.sh has produced a signed app-release.apk (signing happens when
+# keystore.properties is present).
+#
+# Environment:
+# CODEBERG_TOKEN Forgejo API token (secret)
+# CODEBERG_REPO owner/name, e.g. lena/rsend
+# TAG release tag (defaults to CI_COMMIT_TAG)
+# CODEBERG_URL base URL (defaults to https://codeberg.org)
+set -eu
+
+: "${CODEBERG_TOKEN:?set CODEBERG_TOKEN}"
+: "${CODEBERG_REPO:?set CODEBERG_REPO as owner/name}"
+tag=${TAG:-${CI_COMMIT_TAG:?set TAG or CI_COMMIT_TAG}}
+base=${CODEBERG_URL:-https://codeberg.org}
+apk=app/build/outputs/apk/release/app-release.apk
+
+[ -f "$apk" ] || { echo "release: $apk not found; run ci/build.sh first" >&2; exit 1; }
+
+api="$base/api/v1/repos/$CODEBERG_REPO"
+
+# Create the release for the tag and capture its id.
+id=$(curl -fsS -X POST "$api/releases" \
+ -H "Authorization: token $CODEBERG_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d "{\"tag_name\":\"$tag\",\"name\":\"$tag\"}" \
+ | sed -n 's/.*"id":\([0-9][0-9]*\).*/\1/p' | head -1)
+[ -n "$id" ] || { echo "release: could not create release for $tag" >&2; exit 1; }
+
+# Upload the APK as a release asset.
+curl -fsS -X POST "$api/releases/$id/assets?name=rsend-$tag.apk" \
+ -H "Authorization: token $CODEBERG_TOKEN" \
+ -F "attachment=@$apk" >/dev/null
+
+echo "release: uploaded rsend-$tag.apk to $CODEBERG_REPO ($tag)"