Skip to content

Commit

Permalink
Merge pull request #3 from vitoway/main
Browse files Browse the repository at this point in the history
Upload a workflow that can compile and publish windows x64 release engine
  • Loading branch information
rustdesk authored Nov 7, 2024
2 parents 6a1156e + d3c59fe commit e37b91d
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/flutter-engine-windows-x64-release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build Flutter Engine

on: workflow_dispatch

jobs:
build-engine:
runs-on: windows-latest

steps:
- name: Install Depot Tools
uses: newkdev/[email protected]

- name: Set environment variables
run: |
echo "DEPOT_TOOLS_WIN_TOOLCHAIN=0" >> $env:GITHUB_ENV
echo "GYP_MSVS_OVERRIDE_PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise" >> $env:GITHUB_ENV
echo "WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10" >> $env:GITHUB_ENV
- name: Fetch Flutter
run: |
mkdir engine
cd engine
fetch flutter
git -C src/flutter checkout db49896cf25ceabc44096d5f088d86414e05a7aa
$filePath = "src/flutter/shell/platform/windows/flutter_windows_engine.cc"
(Get-Content $filePath) -replace 'ClearCurrent', 'MakeCurrent' | Set-Content $filePath
$filePath = "src/flutter/fml/hex_codec.h"
(Get-Content $filePath | ForEach-Object { if ($_ -eq '#include <string_view>') {"#include <string>`n" + $_} else {$_}}) | Set-Content $filePath
git -C src/flutter status
gclient sync -D
# Compiling the Flutter engine
cd src
python .\flutter\tools\gn --runtime-mode=release
ninja -C .\out\host_release
# Check and compress files
$outputPath = "${{ github.workspace }}\windows-x64-release.zip"
$filesToCompress = Get-ChildItem -Path .\out\host_release\flutter_windows.dll*
if ($filesToCompress) {
Compress-Archive -Path $filesToCompress -DestinationPath $outputPath
} else {
Write-Error "Build output files not found!"
}
# The file will be uploaded to the release page of the repository, and the tag is the branch name of the currently executing workflow.
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: windows-x64-release.zip
tag: ${{ github.ref }}
overwrite: true
body: "Flutter Engine Release"

0 comments on commit e37b91d

Please sign in to comment.