Flutter App

This commit is contained in:
2025-12-14 21:53:46 -05:00
parent 383e2e07bd
commit 7ed7a2470d
108 changed files with 7077 additions and 130 deletions

View File

@@ -1,49 +1,89 @@
# Gitea Actions - Release Workflow
# Gitea Actions - Flutter Release Workflow
This workflow automatically builds and releases rmtPocketWatcher for Windows and Linux when you push a version tag.
This workflow automatically builds and releases rmtPocketWatcher Flutter app for Windows and Android when you push a version tag.
## 🚀 Current Build Targets
- **Windows**: Native desktop application (.zip)
- **Android**: APK package (.apk)
## 📱 Migration from Electron
**⚠️ ELECTRON VERSION DEPRECATED**: The Electron version has been replaced with Flutter for better cross-platform support, native performance, and mobile compatibility.
## How to Trigger a Release
1. Update version in `electron-app/package.json`:
```bash
cd electron-app
npm version patch # or minor, or major
1. Update version in `flutter_app/pubspec.yaml`:
```yaml
version: 1.2.3+4 # Update this line
```
2. Push the tag to Gitea:
2. Push changes to main branch:
```bash
git add flutter_app/pubspec.yaml
git commit -m "Bump version to 1.2.3"
git push origin main
git push origin --tags
```
3. The workflow will automatically:
- Build Windows installer (.exe)
- Build Linux AppImage and .deb package
- Create a GitHub/Gitea release
- Upload all binaries to the release
- Build Windows desktop application
- Build Android APK
- Create a GitHub/Gitea release with both binaries
- Include release notes with download instructions
## Requirements
## 🔧 Manual Development Build
- Gitea Actions must be enabled on your repository
- Runners must be configured for `windows-latest` and `ubuntu-latest`
- Repository must have write permissions for releases
To trigger a manual dev build (debug versions):
## Manual Build
1. Go to Actions tab in your repository
2. Select "Flutter Dev Build" workflow
3. Click "Run workflow"
To build locally without releasing:
This will create debug builds for both Windows and Android.
## 🏗️ Local Development
### Windows
```bash
cd electron-app
npm run electron:build -- --win # Windows
npm run electron:build -- --linux # Linux
cd flutter_app
flutter pub get
flutter run -d windows
```
Outputs will be in `electron-app/release/`
### Android
```bash
cd flutter_app
flutter pub get
flutter run -d android # Requires connected device/emulator
```
## Troubleshooting
### Build Release Locally
```bash
cd flutter_app
flutter build windows --release # Windows
flutter build apk --release # Android
```
## 📋 Requirements
- Gitea Actions enabled on repository
- Runners configured for `windows-latest` and `ubuntu-latest`
- Repository write permissions for releases
- Flutter 3.24.0+ installed on runners
- Java 17 for Android builds
## 🔍 Troubleshooting
If the workflow fails:
- Check that Node.js 20 is available on runners
- Verify all dependencies install correctly
- Check Flutter version compatibility
- Verify all dependencies in `pubspec.yaml`
- Ensure Android SDK is properly configured
- Check Gitea Actions logs for specific errors
- Ensure GITHUB_TOKEN has proper permissions
- Verify GITHUB_TOKEN permissions
## 📦 Release Assets
Each release includes:
- `rmtPocketWatcher-Windows-v{version}.zip` - Windows desktop app
- `rmtPocketWatcher-Android-v{version}.apk` - Android mobile app
- Detailed release notes with installation instructions

View File

@@ -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

View File

@@ -1,61 +1,174 @@
name: Windows Release
name: Flutter Release
on:
workflow_dispatch:
push:
paths:
- 'electron-app/package.json'
- 'flutter_app/pubspec.yaml'
branches:
- main
jobs:
get-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.VERSION }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get version from pubspec.yaml
id: version
working-directory: flutter_app
run: |
VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //' | sed 's/+.*//')
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
build-windows:
runs-on: windows
runs-on: windows-latest
needs: get-version
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Node 20 should be preinstalled on the Windows host runner; skipping setup-node avoids 7zip download issues.
- 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: Create production .env file
working-directory: electron-app
working-directory: flutter_app
env:
WS_URL: ${{ secrets.WS_URL }}
API_URL: ${{ secrets.API_URL }}
run: node scripts/create-env.cjs
run: |
echo "WS_URL=$env:WS_URL" > .env
echo "API_URL=$env:API_URL" >> .env
- name: Verify .env file
working-directory: electron-app
run: type .env
- name: Install dependencies
working-directory: flutter_app
run: flutter pub get
- name: Build TypeScript
working-directory: electron-app
run: npm run build
- name: Build Windows release
working-directory: flutter_app
run: flutter build windows --release
- name: Build Windows portable executable (skip signing)
working-directory: electron-app
- name: Create Windows archive
working-directory: flutter_app
run: |
Compress-Archive -Path "build\windows\x64\runner\Release\*" -DestinationPath "rmtPocketWatcher-Windows-v${{ needs.get-version.outputs.version }}.zip"
- name: Upload Windows artifact
uses: actions/upload-artifact@v4
with:
name: rmtPocketWatcher-Windows
path: flutter_app/rmtPocketWatcher-Windows-v${{ needs.get-version.outputs.version }}.zip
retention-days: 30
build-android:
runs-on: ubuntu-latest
needs: get-version
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 production .env file
working-directory: flutter_app
env:
CSC_IDENTITY_AUTO_DISCOVERY: false
run: npx electron-builder --win portable --config electron-builder.yml
WS_URL: ${{ secrets.WS_URL }}
API_URL: ${{ secrets.API_URL }}
run: |
echo "WS_URL=$WS_URL" > .env
echo "API_URL=$API_URL" >> .env
- name: Get version from package.json
id: version
working-directory: electron-app
run: node scripts/get-version.cjs
- name: Install dependencies
working-directory: flutter_app
run: flutter pub get
- name: Create Release and Upload exe
- name: Build Android APK
working-directory: flutter_app
run: flutter build apk --release
- name: Rename APK
working-directory: flutter_app
run: |
mv build/app/outputs/flutter-apk/app-release.apk rmtPocketWatcher-Android-v${{ needs.get-version.outputs.version }}.apk
- name: Upload Android artifact
uses: actions/upload-artifact@v4
with:
name: rmtPocketWatcher-Android
path: flutter_app/rmtPocketWatcher-Android-v${{ needs.get-version.outputs.version }}.apk
retention-days: 30
create-release:
runs-on: ubuntu-latest
needs: [get-version, build-windows, build-android]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: rmtPocketWatcher-Windows
path: ./artifacts
- name: Download Android artifact
uses: actions/download-artifact@v4
with:
name: rmtPocketWatcher-Android
path: ./artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.version.outputs.VERSION }}
name: rmtPocketWatcher v${{ steps.version.outputs.VERSION }}
tag_name: v${{ needs.get-version.outputs.version }}
name: rmtPocketWatcher v${{ needs.get-version.outputs.version }}
draft: false
prerelease: false
files: electron-app/release/rmtPocketWatcher-*.exe
body: |
## rmtPocketWatcher v${{ needs.get-version.outputs.version }}
**Lambda Banking Conglomerate** - Star Citizen AUEC Price Tracker
### Downloads
- **Windows**: `rmtPocketWatcher-Windows-v${{ needs.get-version.outputs.version }}.zip`
- **Android**: `rmtPocketWatcher-Android-v${{ needs.get-version.outputs.version }}.apk`
### Features
- Real-time AUEC price tracking from multiple vendors
- Bloomberg-style terminal interface
- Cross-platform native notifications with custom sound
- Historical price charts and trend analysis
- Client-side price alerts
- Vendor comparison tables
### Installation
**Windows**: Extract the ZIP file and run `rmtpocketwatcher.exe`
**Android**: Install the APK file (enable "Install from unknown sources")
---
*Built with Flutter for cross-platform compatibility*
files: |
./artifacts/rmtPocketWatcher-Windows-v${{ needs.get-version.outputs.version }}.zip
./artifacts/rmtPocketWatcher-Android-v${{ needs.get-version.outputs.version }}.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}