Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload a workflow that can compile and publish windows x64 release engine #2

Closed
wants to merge 2 commits into from
Closed
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
59 changes: 59 additions & 0 deletions .github/workflows/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: flutter-engine-windows-x64-release.zip
tag: ${{ github.ref }}
overwrite: true
body: "Flutter Engine Release"