Skip to content

Commit 04bce91

Browse files
committed
Unify GitHub workflows - combine CI and release into single workflow
1 parent 102681b commit 04bce91

2 files changed

Lines changed: 64 additions & 80 deletions

File tree

.github/workflows/ci.yml

Lines changed: 64 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,33 @@
1-
name: Build Android & check tests
1+
name: CI & Release
22

33
on:
44
push:
55
branches: [ "main" ]
66
pull_request:
77
branches: [ "main" ]
8+
release:
9+
types: [created]
810

911
jobs:
10-
build-android:
11-
name: Build android
12+
# CI job - runs on push/PR to main
13+
ci:
14+
name: Build & Test
1215
runs-on: ubuntu-latest
16+
if: github.event_name != 'release'
1317

1418
steps:
1519
- uses: actions/checkout@v4
20+
1621
- uses: actions/setup-java@v4
1722
with:
1823
distribution: 'temurin'
19-
java-version: '24'
24+
java-version: '25'
25+
2026
- uses: subosito/flutter-action@v2
21-
with:
27+
with:
2228
flutter-version: '3.35.7'
2329
channel: 'stable'
30+
2431
- name: Cache Flutter dependencies
2532
uses: actions/cache@v3
2633
with:
@@ -29,41 +36,65 @@ jobs:
2936
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
3037
restore-keys: |
3138
${{ runner.os }}-flutter-
32-
- name: Flutter clean
33-
run: flutter clean
39+
40+
- name: Flutter doctor
41+
run: flutter doctor
42+
3443
- name: Install dependencies
3544
run: flutter pub get
45+
3646
- name: Generate l10n
3747
run: flutter gen-l10n
38-
- name: Build apk
48+
49+
- name: Run tests
50+
run: flutter test
51+
52+
- name: Build debug APK
3953
run: flutter build apk --debug
40-
- name: Build appbundle
54+
55+
- name: Build debug appbundle
4156
run: flutter build appbundle --debug
42-
43-
check-tests:
44-
name: Check Tests
57+
58+
# Release job - runs only on release creation
59+
release:
60+
name: Build Release APK
4561
runs-on: ubuntu-latest
62+
if: github.event_name == 'release'
4663

4764
steps:
48-
- uses: actions/checkout@v4
49-
- uses: subosito/flutter-action@v2
50-
with:
51-
flutter-version: '3.35.7'
52-
channel: 'stable'
53-
- name: Cache Flutter dependencies
54-
uses: actions/cache@v3
55-
with:
56-
path: |
57-
~/.pub-cache
58-
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
59-
restore-keys: |
60-
${{ runner.os }}-flutter-
61-
- name: Flutter doctor
62-
run: flutter doctor
63-
- name: Get dependencies
64-
run: flutter pub get
65-
- name: Run l10n generation
66-
run: flutter gen-l10n
67-
- name: Run tests
68-
run: flutter test
65+
- uses: actions/checkout@v4
66+
67+
- uses: actions/setup-java@v4
68+
with:
69+
distribution: 'temurin'
70+
java-version: '25'
71+
72+
- uses: subosito/flutter-action@v2
73+
with:
74+
flutter-version: '3.35.7'
75+
channel: 'stable'
76+
77+
- name: Cache Flutter dependencies
78+
uses: actions/cache@v3
79+
with:
80+
path: |
81+
~/.pub-cache
82+
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
83+
restore-keys: |
84+
${{ runner.os }}-flutter-
85+
86+
- name: Install dependencies
87+
run: flutter pub get
88+
89+
- name: Generate l10n
90+
run: flutter gen-l10n
91+
92+
- name: Build release APK
93+
run: flutter build apk --release
94+
95+
- name: Upload APK
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: release.apk
99+
path: build/app/outputs/flutter-apk/app-release.apk
69100

.github/workflows/release.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)