#!/usr/bin/env bash # release-client.sh — 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 }" 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