Flutter App
This commit is contained in:
@@ -1,55 +1,89 @@
|
||||
name: Manual Dev Build
|
||||
name: Flutter Dev Build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-dev:
|
||||
runs-on: windows
|
||||
build-flutter-dev:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Verify Node.js
|
||||
run: node -v
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: '3.24.0'
|
||||
channel: 'stable'
|
||||
|
||||
- name: Install electron-app dependencies
|
||||
working-directory: electron-app
|
||||
run: npm ci
|
||||
- name: Enable Windows desktop
|
||||
run: flutter config --enable-windows-desktop
|
||||
|
||||
- name: Build TypeScript (main + preload)
|
||||
working-directory: electron-app
|
||||
run: npm run build:main
|
||||
|
||||
- name: Build Renderer (Vite)
|
||||
working-directory: electron-app
|
||||
run: npm run build:renderer
|
||||
|
||||
- name: List dist directory
|
||||
working-directory: electron-app
|
||||
- name: Create dev .env file
|
||||
working-directory: flutter_app
|
||||
run: |
|
||||
Write-Host "=== Dist Directory Structure ==="
|
||||
Get-ChildItem -Recurse dist | Select-Object FullName
|
||||
echo "WS_URL=ws://localhost:3001" > .env
|
||||
echo "API_URL=http://localhost:3001" >> .env
|
||||
|
||||
- name: Package with electron-builder (unpacked only)
|
||||
working-directory: electron-app
|
||||
env:
|
||||
CSC_IDENTITY_AUTO_DISCOVERY: false
|
||||
run: npx electron-builder --win --dir
|
||||
- name: Install dependencies
|
||||
working-directory: flutter_app
|
||||
run: flutter pub get
|
||||
|
||||
- name: List release directory
|
||||
working-directory: electron-app
|
||||
- name: Run Flutter doctor
|
||||
run: flutter doctor -v
|
||||
|
||||
- name: Build Windows debug
|
||||
working-directory: flutter_app
|
||||
run: flutter build windows --debug
|
||||
|
||||
- name: List build directory
|
||||
working-directory: flutter_app
|
||||
run: |
|
||||
Write-Host "=== Release Directory ==="
|
||||
if (Test-Path "release") {
|
||||
Get-ChildItem -Recurse release | Select-Object FullName, Length
|
||||
} else {
|
||||
Write-Host "Release directory not found"
|
||||
}
|
||||
Write-Host "=== Build Directory Structure ==="
|
||||
Get-ChildItem -Recurse build\windows\x64\runner\Debug | Select-Object FullName, Length
|
||||
|
||||
- name: Upload unpacked build
|
||||
- name: Upload debug build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: rmtPocketWatcher-Windows-Unpacked
|
||||
path: electron-app/release/win-unpacked/
|
||||
name: rmtPocketWatcher-Windows-Debug
|
||||
path: flutter_app/build/windows/x64/runner/Debug/
|
||||
retention-days: 7
|
||||
|
||||
build-android-dev:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: '3.24.0'
|
||||
channel: 'stable'
|
||||
|
||||
- name: Create dev .env file
|
||||
working-directory: flutter_app
|
||||
run: |
|
||||
echo "WS_URL=ws://10.0.2.2:3001" > .env
|
||||
echo "API_URL=http://10.0.2.2:3001" >> .env
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: flutter_app
|
||||
run: flutter pub get
|
||||
|
||||
- name: Build Android debug APK
|
||||
working-directory: flutter_app
|
||||
run: flutter build apk --debug
|
||||
|
||||
- name: Upload debug APK
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: rmtPocketWatcher-Android-Debug
|
||||
path: flutter_app/build/app/outputs/flutter-apk/app-debug.apk
|
||||
retention-days: 7
|
||||
|
||||
Reference in New Issue
Block a user