Skip to content

v1.27.1

v1.27.1 #221

Workflow file for this run

name: Build for Windows
on:
# Enable manual run
workflow_dispatch:
push:
tags:
- "**"
branches:
- "**"
paths:
- .github/workflows/windows.yml
- installers/desktop_inno_script.iss
jobs:
build-windows:
name: Build for Windows
runs-on: windows-latest
permissions:
contents: write
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup cache
uses: actions/cache@v4
with:
path: |
.dart_tool/
build/
linux/flutter/ephemeral/
macos/Flutter/ephemeral/
windows/flutter/ephemeral/
.flutter-plugins-dependencies
pubspec.lock
key: ${{ runner.OS }}-saber-${{ hashFiles('**/pubspec.lock') }}-${{ hashFiles('**/*.dart') }}
restore-keys: |
${{ runner.OS }}-saber-
- name: Setup Flutter
uses: adil192/setup-flutter-submodule@v1
with:
flutter-path: submodules/flutter
- name: Disable Flutter CLI animations
run: flutter config --no-cli-animations
- run: flutter pub get
- name: Remove development dependencies
run: ./patches/remove_dev_dependencies.sh
- name: Build Windows
shell: bash
run: |
flutter build windows \
--dart-define=DIRTY=$DIRTY
env:
DIRTY: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Download Visual C++ Redistributable
shell: bash
run: |
curl -L -o installers/vc_redist.x64.exe https://aka.ms/vs/17/release/vc_redist.x64.exe
- name: Install Inno Setup
run: choco install -y innosetup
- name: Build Windows Installer
run: ISCC.exe installers/desktop_inno_script.iss
- name: Rename exe
id: rename
shell: bash
run: |
export LC_ALL=en_US.utf8
buildName=$(grep -oP "(?<=buildName = ').*(?=')" lib/data/version.dart)
installerName="SaberInstaller_v${buildName}.exe"
echo "installerName=$installerName" >> $GITHUB_OUTPUT
mv installers/SaberInstaller.exe installers/$installerName
- name: Upload artifact
uses: actions/upload-artifact@v5
with:
name: Saber-Windows
path: installers/${{ steps.rename.outputs.installerName }}
- name: Upload to GitHub release
uses: svenstaro/upload-release-action@v2
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: installers/${{ steps.rename.outputs.installerName }}