forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from vitoway/main
Upload a workflow that can compile and publish windows x64 release engine
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
.github/workflows/flutter-engine-windows-x64-release-build.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |