Flutter App
This commit is contained in:
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user