ci: update release workflow for Windows installer and Android universal apk

This commit is contained in:
ssbg04 committed 2026-09-14 12:53:21 +08:00
1 parent 8e1cf43b14
commit 0e26fcea35
1 file changed
+46 -13
+46 -13
View File
@@ -4,11 +4,16 @@ on:
push:
tags:
- 'v*' # Triggers whenever you push a tag like v1.0.0
workflow_dispatch: # Allows manual trigger from the GitHub Actions tab
workflow_dispatch:
inputs:
tag_name:
description: 'Release Tag (leave empty to use version from pubspec.yaml, e.g. v1.0.0)'
required: false
default: ''
jobs:
build-and-release:
name: Build Windows Installer & Android APK
name: Build Windows & Android Artifacts
runs-on: windows-latest
permissions:
contents: write # Grants permission to create GitHub Release
@@ -17,7 +22,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Java (needed for Android if building APK)
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
@@ -32,28 +37,56 @@ jobs:
- name: Install Inno Setup
run: choco install innosetup --no-progress
- name: Build Flutter Windows App
- name: Restore google-services.json from Secret
if: env.GOOGLE_SERVICES_JSON != ''
working-directory: frontend/android/app
run: |
Set-Content -Path "google-services.json" -Value $env:GOOGLE_SERVICES_JSON
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
- name: Build Windows Desktop App
working-directory: frontend
run: |
flutter pub get
flutter build windows --release
flutter build windows --release --obfuscate --split-debug-info=build/windows/symbols
- name: Compile Inno Setup Installer
run: |
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" frontend/TIS_RMS_Client.iss
- name: Build Flutter Android APK
- name: Compile Inno Setup Windows Installer
working-directory: frontend
run: |
flutter build apk --release
copy build\app\outputs\flutter-apk\app-release.apk ..\installers\TIS_RMS_Client.apk
New-Item -ItemType Directory -Force -Path ..\installers
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" TIS_RMS_Client.iss
- name: Build Android Universal APK
working-directory: frontend
run: |
flutter build apk --release --obfuscate --split-debug-info=build/app/outputs/symbols
Copy-Item build\app\outputs\flutter-apk\app-release.apk ..\installers\TIS_RMS_Android_Universal.apk -Force
- name: Determine Release Tag
id: release_info
shell: pwsh
run: |
$inputTag = "${{ github.event.inputs.tag_name }}"
if ($inputTag) {
$tag = $inputTag
} elseif ("${{ github.ref }}".StartsWith("refs/tags/")) {
$tag = "${{ github.ref_name }}"
} else {
$rawVer = (Get-Content frontend/pubspec.yaml | Select-String '^version:').Line.Split(':')[1].Split('+')[0].Trim()
$tag = "v$rawVer"
}
Write-Host "Releasing tag: $tag"
Add-Content -Path $env:GITHUB_OUTPUT -Value "tag=$tag"
- name: Upload Artifacts to GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.release_info.outputs.tag }}
name: Release ${{ steps.release_info.outputs.tag }}
files: |
installers/TIS_RMS_Client_Setup.exe
installers/TIS_RMS_Client.apk
installers/TIS_RMS_Android_Universal.apk
generate_release_notes: true
draft: false
prerelease: false