mirror of
https://github.com/tiennm99/loto.git
synced 2026-10-13 16:15:17 +00:00
ci: consolidate web and android workflows into one pipeline
Both subprojects ship from the same commit, so ordinary CI is now a single ci.yml; only the tag-driven release stands apart. The web app is built twice per run — once per base path — and every consumer downloads the artifact instead of rebuilding, replacing three redundant base-"" builds on main. Nothing deploys unless the test job is green, and android-release runs the suite before signing (ci.yml does not fire on tags, so it was the only gap). Shared toolchain setup moves into composite actions, which puts the web build and the APK on the same Node version for the first time. The Firebase PR path was still on npm ci against a stale web/package-lock.json that could resolve a different tree than pnpm-lock.yaml; drop the lockfile and the npm path with it. Also: least-privilege permissions widened per job, persist-credentials off on every checkout, concurrency groups that cancel superseded PRs but never a live deploy, npm caching for android, and the Firebase action pinned by commit SHA to match how the release actions were already pinned.
This commit is contained in:
1 parent
dfc9f67e0c
commit
c6c839fd95
17 files changed
+321
-8681
No files matched your search
@@ -1,3 +1,7 @@
|
||||
# Tag-driven release. Builds standalone rather than consuming ci.yml
|
||||
# artifacts: a tag run has no upstream run to pull from, and a release
|
||||
# should be reproducible from the tagged tree alone.
|
||||
|
||||
name: android / release
|
||||
|
||||
on:
|
||||
@@ -7,40 +11,36 @@ on:
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
concurrency:
|
||||
group: android-release-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: android
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Node 22
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '22'
|
||||
- uses: ./.github/actions/setup-web
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '21'
|
||||
# ci.yml does not run on tags, so this is the only gate before signing.
|
||||
- name: Test web
|
||||
run: pnpm test
|
||||
working-directory: web
|
||||
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@v6
|
||||
with:
|
||||
cache-provider: basic
|
||||
# Base "" — the APK loads the bundle from the domain root.
|
||||
- name: Build web
|
||||
run: pnpm build
|
||||
working-directory: web
|
||||
|
||||
- name: Install wrapper deps
|
||||
run: npm ci
|
||||
- uses: ./.github/actions/setup-android
|
||||
|
||||
- name: Build web + sync into Android
|
||||
run: npm run build
|
||||
- name: Sync web bundle into the native project
|
||||
run: npm run sync
|
||||
working-directory: android
|
||||
|
||||
- name: Decode keystore
|
||||
env:
|
||||
|
||||
Reference in new issue
Block a user