Update SDK

This commit is contained in:
2025-12-15 00:25:01 -05:00
parent 110c5d99a1
commit f4bf073d52
2 changed files with 76 additions and 32 deletions

View File

@@ -33,10 +33,23 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Git Bash (for Flutter internal scripts)
shell: pwsh
run: |
# Add Git Bash to PATH for Flutter internal scripts that might need it
$gitPath = "${env:ProgramFiles}\Git\bin"
if (Test-Path $gitPath) {
$env:PATH = "$gitPath;$env:PATH"
echo "PATH=$env:PATH" >> $env:GITHUB_ENV
Write-Host "Added Git Bash to PATH: $gitPath"
} else {
Write-Host "Git Bash not found at expected location"
}
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.3'
flutter-version: '3.27.1'
channel: 'stable'
cache: true
@@ -44,6 +57,10 @@ jobs:
shell: pwsh
run: flutter config --enable-windows-desktop
- name: Verify Flutter setup
shell: pwsh
run: flutter doctor -v
- name: Create production .env file
working-directory: flutter_app
shell: pwsh
@@ -59,10 +76,6 @@ jobs:
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
@@ -101,16 +114,33 @@ jobs:
# Run our custom build script
.\build_windows.ps1 -Release
# Rename the archive to include version
# The build script creates: build\rmtPocketWatcher-Windows-v{version}-release.zip
# Rename to simpler format for release
$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"
# Find the generated zip and rename it
$sourceZip = "build\rmtPocketWatcher-Windows-v$version-release.zip"
if (Test-Path $sourceZip) {
Move-Item $sourceZip "rmtPocketWatcher-Windows-v$version.zip" -Force
Write-Host "Created rmtPocketWatcher-Windows-v$version.zip"
} else {
# Fallback: find any matching zip
$zipFiles = Get-ChildItem -Path "build" -Filter "rmtPocketWatcher-Windows-*.zip" -ErrorAction SilentlyContinue
if ($zipFiles) {
Move-Item $zipFiles[0].FullName "rmtPocketWatcher-Windows-v$version.zip" -Force
Write-Host "Created rmtPocketWatcher-Windows-v$version.zip from $($zipFiles[0].Name)"
}
}
# Also create a simple executable-only archive
# Create portable (single exe) 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
Compress-Archive -Path "build\windows\standalone\rmtpocketwatcher.exe" -DestinationPath "rmtPocketWatcher-Windows-Portable-v$version.zip" -CompressionLevel Optimal -Force
Write-Host "Created rmtPocketWatcher-Windows-Portable-v$version.zip"
}
# List created artifacts
Write-Host "Artifacts created:"
Get-ChildItem -Filter "*.zip" | ForEach-Object { Write-Host " - $($_.Name)" }
- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
@@ -138,16 +168,20 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.3'
flutter-version: '3.27.1'
channel: 'stable'
cache: true
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Accept Android licenses
shell: bash
run: |
# Install Android SDK using Flutter's built-in tools
flutter doctor --android-licenses || echo "Licenses handled"
flutter doctor -v
run: yes | sdkmanager --licenses || true
- name: Verify Flutter setup
shell: bash
run: flutter doctor -v
- name: Create production .env file
working-directory: flutter_app