Skip to content

ci: PR/CI 包注入 Bangumi OAuth 凭证 - #94

Merged
ModerRAS merged 1 commit into
masterfrom
feat/bangumi-oauth
Oct 19, 2026
Merged

ModerRAS merged 1 commit into
masterfrom
feat/bangumi-oauth

Conversation

@ModerRAS

Copy link
Copy Markdown
Owner

改了什么(纯 CI 接线,无业务代码)

  • app/build.gradle.kts:从 gradle property / 环境变量读 BANGUMI_CLIENT_ID / BANGUMI_CLIENT_SECRET,缺省空字符串,注入 BuildConfig。
  • ci.yml:build(debug APK,产物保留 7 天)和 build-release 两个 job 透传上述 secrets。

为什么先合这个

OAuth 实现分支合进来之前,CI 必须先会打带真凭证的包——否则 HK1 联调时分不清是 plumbing 坏了还是业务代码坏了。这个 PR 合并后,后续 OAuth 分支每次 push 的云端包都自带 secret,可直接装机测。

安全说明

  • 同仓库 PR(含本分支)能读到 secrets;fork 来的 PR 读不到,此时字段为空字符串,构建照常通过,App 内报未配置。
  • secret 只活在 Actions secrets + 构建机环境变量里,不进仓库(PR 前已 git diff 审计)。
  • 泄露预案:去 bgm.tv/dev/app 重置 secret,再更新 secrets 即可;旧包同时作废。

使用方待办(合 PR 不阻塞)

  1. 在仓库 Settings → Secrets → Actions 加 BANGUMI_CLIENT_ID / BANGUMI_CLIENT_SECRET(用 http://127.0.0.1:13712/callback 注册的那个 App)。
  2. 本地打带凭证的包:-PBANGUMI_CLIENT_ID=.. -PBANGUMI_CLIENT_SECRET=.. 或环境变量 / ~/.gradle/gradle.properties。

验证

  • 本地无 secret:./gradlew :app:assembleDebug 通过,生成的 BuildConfig 两字段为空字符串。
  • 云端验证:本 PR 的 CI 跑完后,debug 产物即为带 secret 的包(待合入后用 HK1 实测 OAuth 全链路,见后续 OAuth 实现 PR)。

- app/build.gradle.kts 从 gradle property / 环境变量读
  BANGUMI_CLIENT_ID/SECRET,缺省空字符串(fork PR 照常编译,
  App 内报未配置而非炸构建)
- build(debug APK)与 build-release 两个 job 均透传 secrets,
  debug 产物保留 7 天可直接装 HK1 联调
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 027e4d6f-8f5e-4d93-9f78-40bc64c25ccf
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ModerRAS
ModerRAS merged commit a6999f6 into master Oct 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant