Skip to content

Commit 4bb8e93

Browse files
committed
ci(pipeline): optimize build process and harden release conditions
- Remove redundant `cargo check` step, as `cargo clippy` inherently performs it, saving CI time. - Remove standalone `sync-i18n` job; translation completeness is now strictly enforced as a dry-run check in the test job to fail fast if keys are missing. - Optimize future Android builds by replacing from-source compilation of `cargo-ndk` with pre-built binaries via `cargo-binstall`. - Harden the `create-release` job condition to safely handle optional/skipped Android builds while strictly blocking the release if the Android build is explicitly triggered and fails.
1 parent 0981999 commit 4bb8e93

1 file changed

Lines changed: 14 additions & 32 deletions

File tree

.github/workflows/pipeline.yml

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -139,43 +139,18 @@ jobs:
139139
libxkbcommon-dev \
140140
pkg-config
141141
142-
- name: Check (cargo check)
143-
run: cargo check --locked --target ${{ matrix.target }}
144-
145142
- name: Clippy
146143
run: cargo clippy --locked --target ${{ matrix.target }}
147144

148145
- name: Run Tests
149146
run: cargo test --locked --target ${{ matrix.target }} --verbose
150147

151148
# --------------------------------------------------------------------------
152-
# 3. SYNC I18N JOB — translate missing keys before building release
153-
# --------------------------------------------------------------------------
154-
sync-i18n:
155-
name: Sync Translations
156-
needs: [check-tag, test]
157-
if: needs.check-tag.outputs.is_new == 'true' && needs.test.result == 'success'
158-
runs-on: ubuntu-latest
159-
timeout-minutes: 15
160-
steps:
161-
- uses: actions/checkout@v6
162-
163-
- name: Setup Bun
164-
uses: oven-sh/setup-bun@v2
165-
with:
166-
bun-version: latest
167-
168-
- name: Sync I18n Translations
169-
run: bun scripts/locales-sync.ts
170-
env:
171-
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
172-
173-
# --------------------------------------------------------------------------
174-
# 4. BUILD DESKTOP JOB — Build release binaries
149+
# 3. BUILD DESKTOP JOB — Build release binaries
175150
# --------------------------------------------------------------------------
176151
build-desktop:
177152
name: Build (${{ matrix.os-name }})
178-
needs: [check-tag, sync-i18n]
153+
needs: [check-tag, test]
179154
if: needs.check-tag.outputs.is_new == 'true'
180155
runs-on: ${{ matrix.os }}
181156
timeout-minutes: 60
@@ -262,11 +237,11 @@ jobs:
262237
retention-days: 7
263238

264239
# --------------------------------------------------------------------------
265-
# 5. BUILD ANDROID JOB
240+
# 4. BUILD ANDROID JOB
266241
# --------------------------------------------------------------------------
267242
build-android:
268243
name: Build (Android)
269-
needs: [check-tag, sync-i18n]
244+
needs: [check-tag, test]
270245
if: needs.check-tag.outputs.is_new == 'true' && github.event.inputs.build_android == 'true'
271246
runs-on: ubuntu-latest
272247
timeout-minutes: 60
@@ -278,8 +253,11 @@ jobs:
278253
with:
279254
targets: aarch64-linux-android, x86_64-linux-android
280255

256+
- name: Install cargo-binstall
257+
uses: cargo-bins/cargo-binstall@main
258+
281259
- name: Install cargo-ndk
282-
run: cargo install cargo-ndk
260+
run: cargo binstall -y cargo-ndk
283261

284262
- name: Set up JDK 17
285263
uses: actions/setup-java@v4
@@ -313,12 +291,16 @@ jobs:
313291
retention-days: 7
314292

315293
# --------------------------------------------------------------------------
316-
# 6. CREATE RELEASE JOB
294+
# 5. CREATE RELEASE JOB
317295
# --------------------------------------------------------------------------
318296
create-release:
319297
name: Create GitHub Release
320298
needs: [check-tag, build-desktop, build-android]
321-
if: always() && needs.check-tag.outputs.is_new == 'true' && (needs.build-desktop.result == 'success')
299+
if: >-
300+
always() &&
301+
needs.check-tag.outputs.is_new == 'true' &&
302+
needs.build-desktop.result == 'success' &&
303+
(needs.build-android.result == 'success' || needs.build-android.result == 'skipped')
322304
runs-on: ubuntu-latest
323305
timeout-minutes: 15
324306
permissions:

0 commit comments

Comments
 (0)