Skip to content

Commit

Permalink
Install MinGW from GitHub NuGet registry
Browse files Browse the repository at this point in the history
Attempt to workaround recent, frequent failures of the MinGW jobs by
installing an internalized Chocolatey package hosted on GitHub.
  • Loading branch information
falbrechtskirchinger committed Jul 28, 2022
1 parent 2d48a4d commit c282499
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,31 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up MinGW
uses: egor-tensin/setup-mingw@v2
with:
platform: ${{ matrix.architecture }}
- name: Download MinGW 8.1.0
run: |
$headers = @{Authorization = 'Bearer ${{ secrets.GITHUB_TOKEN }}'}
$uri = 'https://nuget.pkg.github.com/falbrechtskirchinger/download/mingw/8.1.0/mingw.8.1.0.nupkg'
Invoke-WebRequest -Uri $uri -Headers $headers -OutFile mingw.8.1.0.nupkg
- name: Uninstall MinGW
continue-on-error: true
run: choco uninstall mingw
# Based on egor-tensin/setup-mingw
- name: Install MinGW 8.1.0
run: |
choco install mingw.8.1.0.nupkg ${{ matrix.architecture == 'x86' && '--x86' || '' }}
$prefix = "${{ matrix.architecture == 'x64' && 'x86_64-w64-mingw32' || 'i686-w64-mingw32' }}"
$mingw = "${{ matrix.architecture == 'x64' && 'mingw64' || 'mingw32' }}"
$mingw_install = Join-Path C: ProgramData chocolatey lib mingw tools install
$mingw_root = Join-Path $mingw_install $mingw
$mingw_bin = Join-Path $mingw_root bin
$mingw_lib = Join-Path $mingw_root $prefix lib
echo $mingw_bin >> $env:GITHUB_PATH
Remove-Item (Join-Path $mingw_lib 'libpthread.dll.a')
Remove-Item (Join-Path $mingw_lib 'libwinpthread.dll.a')
#- name: Set up MinGW
# uses: egor-tensin/setup-mingw@v2
# with:
# platform: ${{ matrix.architecture }}
- name: cmake
run: cmake -S . -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
- name: build
Expand Down

0 comments on commit c282499

Please sign in to comment.