Files
rmtPocketWatcher/.gitea/workflows/release.yml
HRiggs 110c5d99a1
Some checks failed
Flutter Release / get-version (push) Successful in 7s
Flutter Release / build-windows (push) Failing after 9s
Flutter Release / create-release (push) Has been cancelled
Flutter Release / build-android (push) Has been cancelled
Signing, Installer, New Workflows
2025-12-15 00:05:29 -05:00

245 lines
8.6 KiB
YAML

name: Flutter Release
on:
workflow_dispatch:
push:
paths:
- '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
shell: bash
run: |
VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //' | sed 's/+.*//')
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
build-windows:
runs-on: windows-latest
needs: get-version
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.3'
channel: 'stable'
cache: true
- name: Enable Windows desktop
shell: pwsh
run: flutter config --enable-windows-desktop
- name: Create production .env file
working-directory: flutter_app
shell: pwsh
env:
WS_URL: ${{ secrets.WS_URL }}
API_URL: ${{ secrets.API_URL }}
run: |
"WS_URL=$env:WS_URL" | Out-File -FilePath .env -Encoding utf8
"API_URL=$env:API_URL" | Out-File -FilePath .env -Append -Encoding utf8
- name: Install dependencies
working-directory: flutter_app
shell: pwsh
run: flutter pub get
- name: Flutter doctor
shell: pwsh
run: flutter doctor -v
- name: Setup Certificate for Signing
working-directory: flutter_app
shell: pwsh
env:
CERT_BASE64: ${{ secrets.CERT_BASE64 }}
CERT_PASSWORD: ${{ secrets.CERT_PASSWORD }}
run: |
if ($env:CERT_BASE64) {
Write-Host "Setting up certificate for code signing..." -ForegroundColor Green
# Create certificates directory if it doesn't exist
if (-not (Test-Path "certificates")) {
New-Item -ItemType Directory -Path "certificates" -Force | Out-Null
}
# Decode base64 certificate and save as PFX
$certBytes = [System.Convert]::FromBase64String($env:CERT_BASE64)
[System.IO.File]::WriteAllBytes("certificates\rmtPocketWatcher.pfx", $certBytes)
Write-Host "✅ Certificate installed successfully" -ForegroundColor Green
} else {
Write-Host "⚠️ No certificate provided - building unsigned" -ForegroundColor Yellow
}
- name: Build Windows release with installer
working-directory: flutter_app
shell: pwsh
env:
CERT_PASSWORD: ${{ secrets.CERT_PASSWORD }}
run: |
# Set certificate password environment variable for build script
if ($env:CERT_PASSWORD) {
$env:MSIX_CERTIFICATE_PASSWORD = $env:CERT_PASSWORD
}
# Run our custom build script
.\build_windows.ps1 -Release
# Rename the archive to include version
$version = "${{ needs.get-version.outputs.version }}"
if (Test-Path "build\rmtPocketWatcher-Windows-Standalone.zip") {
Rename-Item "build\rmtPocketWatcher-Windows-Standalone.zip" "rmtPocketWatcher-Windows-v$version.zip"
}
# Also create a simple executable-only archive
if (Test-Path "build\windows\standalone\rmtpocketwatcher.exe") {
Compress-Archive -Path "build\windows\standalone\rmtpocketwatcher.exe" -DestinationPath "rmtPocketWatcher-Windows-Portable-v$version.zip" -CompressionLevel Optimal
}
- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: rmtPocketWatcher-Windows
path: |
flutter_app/rmtPocketWatcher-Windows-v${{ needs.get-version.outputs.version }}.zip
flutter_app/rmtPocketWatcher-Windows-Portable-v${{ needs.get-version.outputs.version }}.zip
flutter_app/build/windows/x64/runner/Release/*.msix
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.22.3'
channel: 'stable'
cache: true
- name: Setup Android SDK
shell: bash
run: |
# Install Android SDK using Flutter's built-in tools
flutter doctor --android-licenses || echo "Licenses handled"
flutter doctor -v
- name: Create production .env file
working-directory: flutter_app
shell: bash
env:
WS_URL: ${{ secrets.WS_URL }}
API_URL: ${{ secrets.API_URL }}
run: |
echo "WS_URL=$WS_URL" > .env
echo "API_URL=$API_URL" >> .env
- name: Install dependencies
working-directory: flutter_app
shell: bash
run: flutter pub get
- name: Build Android APK
working-directory: flutter_app
shell: bash
run: flutter build apk --release
- name: Rename APK
working-directory: flutter_app
shell: bash
run: |
cp 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${{ needs.get-version.outputs.version }}
name: rmtPocketWatcher v${{ needs.get-version.outputs.version }}
draft: false
prerelease: false
body: |
## rmtPocketWatcher v${{ needs.get-version.outputs.version }}
**Lambda Banking Conglomerate** - Star Citizen AUEC Price Tracker
### Downloads
- **Windows (Full)**: `rmtPocketWatcher-Windows-v${{ needs.get-version.outputs.version }}.zip` - Complete standalone package
- **Windows (Portable)**: `rmtPocketWatcher-Windows-Portable-v${{ needs.get-version.outputs.version }}.zip` - Single executable only
- **Windows (Installer)**: `*.msix` - Windows Store-style installer (if available)
- **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 (Full)**: Extract the ZIP file and run `rmtpocketwatcher.exe` - includes all dependencies
**Windows (Portable)**: Single executable, no installation needed - just run `rmtpocketwatcher.exe`
**Windows (Installer)**: Double-click the MSIX file for Windows Store-style installation
**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-Windows-Portable-v${{ needs.get-version.outputs.version }}.zip
./artifacts/*.msix
./artifacts/rmtPocketWatcher-Android-v${{ needs.get-version.outputs.version }}.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}