Files
pangolin/scripts/ci/release-client.sh
T
wangjia 2698116696 feat(ci): 客户端 CI 脚手架(Android+Windows, 照 jiu)——起草+Android 本地验证
- compile-android.sh: 建 libbox.aar + split-per-abi 取 arm64-v8a(~82MB, 避 232MB
  universal) + release 签名(RELEASE_KEYSTORE/KEY_PASSWORD)。本地已验证构建通过、
  libbox.so 打进 APK。
- compile-windows.sh: 复用 client/windows/installer/pangolin.iss(Inno Setup),不签名。
- release-client.sh / deploy-client.sh: 复用 pangolin lib-forgejo/lib-ssh,传 Gitea
  release + 部署最新到 pangolin1:/var/lib/pangolin/downloads(仅留最新)。
- deploy-client.yml: client-v* tag → build-android(mac)+build-windows(windows) → release-deploy(mac)。
- build.gradle: 补 release 签名 config(读 key.properties, 缺则回退 debug)。
- 待确认: keystore alias/密码(见脚本 TODO);runner 需提到 user 级;服务器 /downloads + 官网链接下一步。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
2026-07-06 19:40:34 +08:00

53 lines
2.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# release-client.sh <tag> — ensure the Forgejo release for a client-v* tag
# exists and upload whichever client artifacts are present in dist/.
#
# Mirrors ~/code/jiu/scripts/ci/release-client.sh's asset-guarding pattern,
# but uses pangolin's own lib-forgejo.sh API (forgejo_release_ensure /
# forgejo_upload_asset — different names/signature than jiu's create_release/
# upload_asset) and drops jiu's version.yaml/CHANGELOG bookkeeping entirely:
# pangolin has no equivalent backend/config/version.yaml manifest — client
# self-update checking is out of scope here (server just serves the release
# assets; see deploy-client.sh).
#
# Multiple platform build jobs (android/windows/...) all upload into the SAME
# release, guarded by `[ -f ... ]` since a given CI run may only have built a
# subset (e.g. a partial manual re-dispatch, or before macOS/iOS land).
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=scripts/ci/_env.sh
. "${SCRIPT_DIR}/_env.sh"
# shellcheck source=scripts/ci/lib-forgejo.sh
. "${SCRIPT_DIR}/lib-forgejo.sh"
TAG="${1:?usage: release-client.sh <tag>}"
ver_file="/tmp/release_client_ver.$$"
ver_from_tag client "$TAG" > "$ver_file"
VER=""
read -r VER < "$ver_file" || true # 无结尾换行的 read 退出码,见 release-server.sh 同注释
rm -f "$ver_file"
echo "==> release-client: tag=${TAG} ver=${VER}"
forgejo_release_ensure "$TAG" "client ${VER}"
if [ -f dist/pangolin-android.apk ]; then
forgejo_upload_asset "$TAG" dist/pangolin-android.apk
fi
if [ -f dist/pangolin-windows-x64-setup.exe ]; then
forgejo_upload_asset "$TAG" dist/pangolin-windows-x64-setup.exe
fi
# TODO(controller): macOS artifact not yet built by any compile-*.sh in this
# draft (Phase 3 / Task 9 of docs/superpowers/plans/2026-07-05-cicd.md is out
# of scope for this task). Once compile-macos.sh lands, add here:
# if [ -f dist/pangolin-macos-x64.zip ]; then
# forgejo_upload_asset "$TAG" dist/pangolin-macos-x64.zip
# fi
echo "==> release-client: done — Release ${TAG} updated. dist/ contents:"
ls -lh dist/ 2>/dev/null || true