Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions .github/workflows/manual-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
- 'v*'

env:
FLUTTER_VERSION: ${{ github.event.inputs.flutter_version || '3.41.9' }}
FLUTTER_VERSION: ${{ github.event.inputs.flutter_version }}
FLUTTER_CHANNEL: ${{ github.event.inputs.flutter_channel || 'stable' }}

jobs:
Expand All @@ -56,11 +56,28 @@
- run: sudo apt-get install libstdc++6

- uses: actions/checkout@v4

- name: Resolve Flutter version
id: flutter-version
shell: bash
run: |
if [ -n "$FLUTTER_VERSION" ]; then
echo "version=$FLUTTER_VERSION" >> "$GITHUB_OUTPUT"
exit 0
fi

version="$(curl -fsSL https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json | python3 -c 'import json, sys; data = json.load(sys.stdin); stable = data["current_release"]["stable"]; print(next(release["version"] for release in data["releases"] if release["hash"] == stable))')"
if [ -z "$version" ]; then
echo "Failed to resolve latest stable Flutter version" >&2
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"

- uses: subosito/flutter-action@v2
with:
# https://github.com/subosito/flutter-action/issues/345#issuecomment-2657332687
channel: 'master'
flutter-version: ${{ env.FLUTTER_VERSION }}
flutter-version: ${{ steps.flutter-version.outputs.version }}

- uses: actions-rs/toolchain@v1
with:
Expand Down Expand Up @@ -273,90 +290,90 @@
overwrite: true

build-windows:
runs-on: windows-latest
runs-on: windows-2022
if: contains(github.event.inputs.platforms, 'windows') || github.event.inputs.platforms == ''
steps:
- uses: actions/checkout@v4

- uses: subosito/flutter-action@v2
with:
channel: ${{ env.FLUTTER_CHANNEL }}
flutter-version: ${{ env.FLUTTER_VERSION }}

- uses: actions-rs/toolchain@v1
with:
toolchain: 'stable' # 'stable' or 'nightly'
override: true
components: rustfmt, clippy

- run: flutter --version

- name: Generator ENV
run: |
echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .env

- name: Run Build Runner
run: dart run build_runner build --delete-conflicting-outputs

# https://stackoverflow.com/questions/22575662/filename-too-long-in-git-for-windows/22575737#22575737
- run: git config --system core.longpaths true

- run: flutter config --enable-windows-desktop
# fix error when dump debug info: (msdia*.dll unregistered?)
- run: regsvr32 "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Remote Debugger\x64\msdia140.dll"

- uses: ilammy/setup-nasm@v1

- name: Build APP
id: build-app
run: |
$version_str=$(gc .\pubspec.yaml | select-string '(?<=^version: ).*' -AllMatches | Select-Object -Expand Matches | %{$_.Value})
$version=$version_str.Split("+")[0]
$build_number=$version_str.Split("+")[1]
flutter build windows --dart-define="APP_VERSION=$version" --dart-define="APP_BUILD_NUMBER=$build_number"
echo "MSIX_PACKAGE_VERSION=$version.0" >> $Env:GITHUB_OUTPUT

- name: Build Installer
run: |
if (Test-Path "${env:ProgramFiles(x86)}\Inno Setup 6\iscc.exe") {
& "${env:ProgramFiles(x86)}\Inno Setup 6\iscc.exe" "windows_inno_setup.iss"
} else {
Write-Error "Inno Setup compiler (iscc.exe) not found at expected location"
exit 1
}

- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: mixin_desktop_windows_setup_amd64.exe.zip
path: build\mixin_desktop_windows_setup_amd64.exe

- name: Build msix
run: |
echo "create msix. version: ${{ steps.build-app.outputs.MSIX_PACKAGE_VERSION }}"
flutter pub run msix:create --build-windows false --version ${{ steps.build-app.outputs.MSIX_PACKAGE_VERSION }} -v

- name: Upload msix
uses: actions/upload-artifact@v4
with:
name: flutter_app.msix.zip
path: build\windows\x64\runner\Release\flutter_app.msix

- name: collect debug info
run: flutter pub run debug_info_collector

- name: Upload debug info
uses: actions/upload-artifact@v4
with:
name: windows_debug_info
path: build\syms

- name: Upload windows setup exe
uses: svenstaro/upload-release-action@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/mixin_desktop_windows_setup_amd64.exe
asset_name: mixin_desktop_windows_setup_amd64.exe
tag: ${{ github.ref }}
overwrite: true

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
2 changes: 1 addition & 1 deletion lib/utils/system/package_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import '../logger.dart';
// auto added by .github/workflows/manual-build.yml
const _kAppVersion = String.fromEnvironment(
'APP_VERSION',
defaultValue: '1.15.0',
defaultValue: '4.3.0',
);
const _kAppBuildNumber = String.fromEnvironment(
'APP_BUILD_NUMBER',
Expand Down
Loading