Skip to content

Commit

Permalink
add visual studio workaround for gcc error
Browse files Browse the repository at this point in the history
  • Loading branch information
EricApostal committed Dec 19, 2024
1 parent c73ed41 commit 7040693
Showing 1 changed file with 53 additions and 44 deletions.
97 changes: 53 additions & 44 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,50 +79,59 @@ jobs:
path: bonfire/build/app/outputs/bundle/release/app-release.aab

build-windows:
runs-on: windows-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
with:
submodules: recursive

- name: Set up Java 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'

- name: Install MinGW
uses: egor-tensin/setup-mingw@v2
with:
platform: x64
version: 14.2.0

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable

- name: Install dependencies
working-directory: ./bonfire
run: flutter pub get

- name: Run code generation
working-directory: ./bonfire
run: dart run build_runner build --delete-conflicting-outputs

- name: Build Windows
working-directory: ./bonfire
env:
CC: gcc
CXX: g++
run: flutter build windows --no-tree-shake-icons -v

- name: Upload Windows Executable
uses: actions/upload-artifact@v4
with:
name: bonfire-windows
path: bonfire/build/windows/x64/runner/Release/
runs-on: windows-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
with:
submodules: recursive

- name: Set up Java 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'

- name: Cleanup Visual Studio Installer
continue-on-error: true
run: |
& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\InstallCleanup.exe"
shell: pwsh

- name: Install Visual Studio 2022 Enterprise
run: |
Invoke-WebRequest -Uri https://aka.ms/vs/17/release.ltsc.17.10/vs_enterprise.exe -OutFile vs_enterprise.exe
$process = Start-Process -FilePath '.\vs_enterprise.exe' -ArgumentList "--add", "Microsoft.VisualStudio.Workload.Azure", "--quiet", "--norestart", "--wait", "--includeRecommended" -Wait -PassThru
Write-Output $process.ExitCode
$process = Start-Process -FilePath '.\vs_enterprise.exe' -ArgumentList "--add", "Microsoft.VisualStudio.Workload.NativeDesktop", "--quiet", "--norestart", "--wait", "--includeRecommended" -Wait -PassThru
Write-Output $process.ExitCode
shell: pwsh

- name: Set up Visual Studio
uses: microsoft/setup-msbuild@v1.1

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable

- name: Install dependencies
working-directory: ./bonfire
run: flutter pub get

- name: Run code generation
working-directory: ./bonfire
run: dart run build_runner build --delete-conflicting-outputs

- name: Build Windows
working-directory: ./bonfire
run: flutter build windows --no-tree-shake-icons -v

- name: Upload Windows Executable
uses: actions/upload-artifact@v4
with:
name: bonfire-windows
path: bonfire/build/windows/x64/runner/Release/

build-linux:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 7040693

Please sign in to comment.