Skip to content

Commit bb1a771

Browse files
committed
Updated workflow for client build
1 parent a927d17 commit bb1a771

File tree

2 files changed

+114
-5
lines changed

2 files changed

+114
-5
lines changed

.github/workflows/ci.yml

Lines changed: 113 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@ jobs:
3737
- uses: subosito/flutter-action@v2
3838
with:
3939
channel: stable
40+
- name: Generate Flutter Icons
41+
working-directory: client
42+
run: dart run flutter_launcher_icons
4043
- name: Build Flutter web (release)
4144
working-directory: client
42-
run: flutter build web --release --wasm
45+
run: flutter build web --release --wasm --no-web-resources-cdn
4346
- name: Upload web client artifact
4447
uses: actions/upload-artifact@v4
4548
with:
@@ -135,10 +138,116 @@ jobs:
135138
path: ${{ matrix.artifact }}.${{ matrix.archive }}
136139
retention-days: 5
137140

141+
# ── Build client desktop & Android ──────────────────────────────────
142+
build-client:
143+
name: Build Client (${{ matrix.name }})
144+
needs: [read-version]
145+
strategy:
146+
matrix:
147+
include:
148+
- name: linux-x86_64
149+
runner: ubuntu-latest
150+
build-cmd: linux
151+
artifact: timekeeper-client-linux-x86_64
152+
artifact-path: client/build/linux/x64/release/bundle
153+
archive: tar.gz
154+
- name: windows-x86_64
155+
runner: windows-latest
156+
build-cmd: windows
157+
artifact: timekeeper-client-windows-x86_64
158+
artifact-path: client/build/windows/x64/runner/Release
159+
archive: zip
160+
- name: macos-x86_64
161+
runner: macos-latest
162+
build-cmd: macos
163+
artifact: timekeeper-client-macos-x86_64
164+
artifact-path: client/build/macos/Build/Products/Release
165+
archive: zip
166+
- name: macos-aarch64
167+
runner: macos-latest
168+
build-cmd: macos
169+
artifact: timekeeper-client-macos-aarch64
170+
artifact-path: client/build/macos/Build/Products/Release
171+
archive: zip
172+
- name: android
173+
runner: ubuntu-latest
174+
build-cmd: apk
175+
artifact: timekeeper-client-android
176+
artifact-path: client/build/app/outputs/flutter-apk/app-release.apk
177+
archive: none
178+
runs-on: ${{ matrix.runner }}
179+
steps:
180+
- uses: actions/checkout@v4
181+
182+
- uses: subosito/flutter-action@v2
183+
with:
184+
channel: stable
185+
186+
# Android needs Java
187+
- name: Setup Java
188+
if: matrix.build-cmd == 'apk'
189+
uses: actions/setup-java@v4
190+
with:
191+
distribution: temurin
192+
java-version: "17"
193+
194+
# Linux desktop needs build dependencies
195+
- name: Install Linux dependencies
196+
if: matrix.build-cmd == 'linux'
197+
run: |
198+
sudo apt-get update
199+
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev
200+
201+
- name: Generate Flutter Icons
202+
working-directory: client
203+
run: dart run flutter_launcher_icons
204+
205+
- name: Build client (release)
206+
working-directory: client
207+
run: flutter build ${{ matrix.build-cmd }} --release
208+
209+
# Archive: tar.gz (Linux)
210+
- name: Prepare archive (tar.gz)
211+
if: matrix.archive == 'tar.gz'
212+
run: |
213+
cd ${{ matrix.artifact-path }}
214+
tar -czf ${{ github.workspace }}/${{ matrix.artifact }}.tar.gz .
215+
216+
# Archive: zip (Windows/macOS)
217+
- name: Prepare archive (zip - Unix)
218+
if: matrix.archive == 'zip' && runner.os != 'Windows'
219+
run: |
220+
cd "${{ matrix.artifact-path }}"
221+
zip -r "${{ github.workspace }}/${{ matrix.artifact }}.zip" .
222+
223+
- name: Prepare archive (zip - Windows)
224+
if: matrix.archive == 'zip' && runner.os == 'Windows'
225+
shell: pwsh
226+
run: |
227+
Compress-Archive -Path "${{ matrix.artifact-path }}\*" -DestinationPath "${{ github.workspace }}\${{ matrix.artifact }}.zip"
228+
229+
# Upload archived artifact
230+
- name: Upload artifact (archived)
231+
if: matrix.archive != 'none'
232+
uses: actions/upload-artifact@v4
233+
with:
234+
name: ${{ matrix.artifact }}
235+
path: ${{ matrix.artifact }}.${{ matrix.archive }}
236+
retention-days: 5
237+
238+
# Upload APK directly (no archive needed)
239+
- name: Upload artifact (apk)
240+
if: matrix.archive == 'none'
241+
uses: actions/upload-artifact@v4
242+
with:
243+
name: ${{ matrix.artifact }}
244+
path: ${{ matrix.artifact-path }}
245+
retention-days: 5
246+
138247
# ── Create GitHub Release ───────────────────────────────────────────
139248
release:
140249
name: Create Release
141-
needs: [read-version, build-server]
250+
needs: [read-version, build-server, build-client]
142251
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci-cd')
143252
runs-on: ubuntu-latest
144253
permissions:
@@ -150,7 +259,7 @@ jobs:
150259
uses: actions/download-artifact@v4
151260
with:
152261
path: artifacts
153-
pattern: timekeeper-server-*
262+
pattern: timekeeper-*
154263

155264
- name: List artifacts
156265
run: find artifacts -type f
@@ -160,7 +269,7 @@ jobs:
160269
with:
161270
tag_name: v${{ needs.read-version.outputs.version }}
162271
name: TimeKeeper v${{ needs.read-version.outputs.version }}
163-
draft: false
272+
draft: true
164273
prerelease: false
165274
files: |
166275
artifacts/**/*

client/lib/base/base_rail.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class BaseRail extends HookConsumerWidget {
99
@override
1010
Widget build(BuildContext context, WidgetRef ref) {
1111
// Derive selected index from current route instead of local state
12-
final selectedIndex = AppRoute.currentRailIndex(context) ?? 0;
12+
final selectedIndex = AppRoute.currentRailIndex(context);
1313
final isExtended = useState(false);
1414
return Positioned(
1515
left: 0,

0 commit comments

Comments
 (0)