Skip to content

docs: stop pointing a public README at the private server repo #95

docs: stop pointing a public README at the private server repo

docs: stop pointing a public README at the private server repo #95

Workflow file for this run

name: Build APK
on:
push:
branches: [ main, master ]
workflow_dispatch:
# Opt the still-Node-20 actions (setup-android, upload-artifact) onto Node 24
# now, ahead of the 2026-06-16 forced migration.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
# A newer push to the same ref cancels the in-progress build.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Setup Android SDK
uses: android-actions/setup-android@v3
# 没有 google-services.json 编译直接失败;从仓库 secret 注入(debug 构建也要)
- name: Inject google-services.json
env:
GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }}
run: |
if [ -z "$GOOGLE_SERVICES_JSON_BASE64" ]; then
echo "::error::GOOGLE_SERVICES_JSON_BASE64 未设置 —— 构建需要 Firebase 配置。请在仓库 Secrets 配置后重试。"
exit 1
fi
echo "$GOOGLE_SERVICES_JSON_BASE64" | tr -d ' \t\r\n' | base64 -d > app/google-services.json
- name: Grant execute permission to gradlew
run: chmod +x gradlew
- name: Build Debug APK
run: ./gradlew assembleDebug --no-daemon
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: Secretary-debug
path: app/build/outputs/apk/debug/app-debug.apk
# 1 天。
#
# 这个包 18 MB,每次 push 都产一个,而配额是**整个组织共享的 500 MB**(GitHub Free)——
# 这个组织下有三十个仓库,其中 SMSForwarder 一个就占了 174 MB。也就是说本仓库能用的额度
# 远小于 500 MB,而一天十几次提交就是 200 MB 上下。30 天保留曾把它推到 1.19 GB,7 天仍然
# 只是把同一个问题推迟几天。
#
# 超额之后的表现极其隐蔽,这是必须写下来的部分:上传步骤**完整成功** —— 打印
# "successfully finalized"、给出 artifact id 和下载 URL、run 显示绿色 —— 然后那个 id
# 按接口查是 404。也就是说"CI 全绿但没有包"是它唯一的症状,日志里没有任何一行提到配额。
#
# 1 天够当天装;需要更早的提交就用 workflow_dispatch 重跑那个 commit,几分钟就有,而不是
# 让三十个仓库共享的额度替我们保存一份没人会装的历史包。
#
# EN: one day. This artifact is 18 MB and every push produces one, while the quota is 500 MB
# shared across the WHOLE ORGANISATION (GitHub Free) — thirty repos, one of which
# (SMSForwarder) alone holds 174 MB. So this repo's real allowance is far below 500 MB, and a
# dozen commits in a day is ~200 MB. Thirty days once pushed it to 1.19 GB; seven days only
# postpones the same problem.
#
# How it fails is the part worth recording: the upload step SUCCEEDS COMPLETELY — it prints
# "successfully finalized", gives an artifact id and a download URL, and the run is green —
# and then that id is a 404. "CI is green but there is no APK" is the only symptom, and no
# line in the log mentions the quota.
#
# One day covers installing it the same day; for an older commit, re-run that commit through
# workflow_dispatch and have it in minutes, rather than spending an allowance shared by thirty
# repos on history builds nobody will install.
retention-days: 1