# Gitea Actions - Flutter Release Workflow

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 `flutter_app/pubspec.yaml`:
   ```yaml
   version: 1.2.3+4  # Update this line
   ```

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

3. The workflow will automatically:
   - Build Windows desktop application
   - Build Android APK
   - Create a GitHub/Gitea release with both binaries
   - Include release notes with download instructions

## 🔧 Manual Release Build

To trigger a manual release build:

1. Go to Actions tab in your repository
2. Select "Flutter Release" workflow
3. Click "Run workflow"

This will create production builds for both Windows and Android and publish a release.

## 🏗️ Local Development

### Windows
```bash
cd flutter_app
flutter pub get
flutter run -d windows
```

### Android
```bash
cd flutter_app
flutter pub get
flutter run -d android  # Requires connected device/emulator
```

### 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 Flutter version compatibility
- Verify all dependencies in `pubspec.yaml`
- Ensure Android SDK is properly configured
- Check Gitea Actions logs for specific errors
- 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
