Skip to content

ci: add android-release GitHub Actions workflow (AAB + debug APK upload) #4

ci: add android-release GitHub Actions workflow (AAB + debug APK upload)

ci: add android-release GitHub Actions workflow (AAB + debug APK upload) #4

name: Build Windows Release
on:
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: write
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Flutter pub get
run: flutter pub get
- name: Locate MSBuild and add to PATH
shell: powershell
run: |
Write-Output "Locating MSBuild with vswhere and adding to PATH"
$vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe'
if (-not (Test-Path $vswhere)) {
Write-Error "vswhere not found at $vswhere"
exit 1
}
$inst = & $vswhere -latest -requires Microsoft.Component.MSBuild -products * -property installationPath
if (-not $inst) {
Write-Error "Visual Studio with MSBuild not found"
exit 1
}
$msbuildDir = Join-Path $inst 'MSBuild\Current\Bin'
Write-Output "Found MSBuild dir: $msbuildDir"
Add-Content -Path $env:GITHUB_PATH -Value $msbuildDir
- name: Verify VS toolchain
shell: powershell
run: |
Write-Output "--- Verify MSVC / MSBuild / NuGet ---"
msbuild -version
if (Get-Command cl.exe -ErrorAction SilentlyContinue) { cl.exe /? } else { Write-Output 'cl.exe not found' }
if (-not (Get-Command nuget -ErrorAction SilentlyContinue)) { choco install nuget.commandline -y }
nuget help
- name: Build Windows release
run: flutter build windows --release
- name: Zip Release
shell: powershell
run: |
Compress-Archive -Path 'build\\windows\\x64\\runner\\Release\\*' -DestinationPath 'picoclaw_flutter_ui-release.zip' -Force
- name: Prepare release metadata
shell: powershell
id: vars
run: |
# Compute timestamp and short commit SHA
$now = Get-Date -Format 'yyyyMMdd-HHmmss'
$short = git rev-parse --short=6 HEAD
$tag = "picoclaw_fui-$now-$short"
Write-Output "Computed release tag: $tag"
# Write outputs for later steps
Add-Content -Path $env:GITHUB_OUTPUT -Value "release_tag=$tag"
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ steps.vars.outputs.release_tag }}
release_name: ${{ steps.vars.outputs.release_tag }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./picoclaw_flutter_ui-release.zip
asset_name: picoclaw_flutter_ui-release.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}