Skip to content

Complile Inno Setup Installer for Windows #5

Complile Inno Setup Installer for Windows

Complile Inno Setup Installer for Windows #5

name: Complile Inno Setup Installer for Windows
on:
workflow_dispatch:
inputs:
version:
description: 'App version override (leave empty to extract from pubspec.yaml)'
required: false
default: ''
jobs:
extract_version:
name: 📝 Extract App Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Extract version from pubspec.yaml or use input
id: get_version
run: |
if [ -z "${{ github.event.inputs.version }}" ]; then
VERSION=$(grep -oP 'version:\s*\K[\d\.]+(?=\+)' pubspec.yaml)
else
VERSION="${{ github.event.inputs.version }}"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Using version: $VERSION"
build_windows:
name: 🪟 Build Windows App
needs: extract_version
runs-on: windows-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Build App
run: |
flutter pub get
flutter build windows --release
- name: Download Visual C++ Redistributable DLLs
run: |
Invoke-WebRequest -Uri "https://github.com/My-Quran-Tajwid/visual-cpp-redistributable/archive/refs/heads/main.zip" -OutFile "vcredist.zip"
Expand-Archive -Path "vcredist.zip" -DestinationPath "temp_vcredist"
Copy-Item -Path "temp_vcredist\visual-cpp-redistributable-main\*.dll" -Destination "build\windows\x64\runner\Release\" -Force
- name: Run Inno Setup Compiler
run: |
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "inno-compiler\inno-build-installer.iss"
shell: cmd
- name: Rename installer to include version
run: |
Move-Item -Path "build\installer\app-windows-installer.exe" -Destination "MQJ-${{ needs.extract_version.outputs.version }}-windows-64-installer.exe" -Force
- name: Upload Windows installer as artifact
uses: actions/upload-artifact@v4
with:
name: MQJ-${{ needs.extract_version.outputs.version }}-windows-installer
path: MQJ-${{ needs.extract_version.outputs.version }}-windows-64-installer.exe