Skip to content

Commit

Permalink
build: Fix Windows build. (#582)
Browse files Browse the repository at this point in the history
* build: Fix Windows build.

This commit resolves the Windows build issue by specifying the MSYS2
"system" we want to use, which is mingw64.

* Try pinning libwebp version.

* Fix windows main build.
  • Loading branch information
betterengineering committed Jan 19, 2023
1 parent 7051ee9 commit ad48bb3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 9 deletions.
29 changes: 23 additions & 6 deletions .github/workflows/main.yml
Expand Up @@ -47,12 +47,13 @@ jobs:
uses: msys2/setup-msys2@v2
if: matrix.os == 'windows-latest'
with:
msystem: mingw64
update: true
install: >-
make
curl
mingw-w64-x86_64-go
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-libwebp
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -65,6 +66,14 @@ jobs:
if: matrix.os == 'macos-latest'
run: ./scripts/setup-macos.sh

- name: Install Windows dependencies
if: matrix.os == 'windows-latest'
shell: msys2 {0}
run: |
set MSYSTEM=MINGW64
curl -LO https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libwebp-1.2.4-4-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-x86_64-libwebp-1.2.4-4-any.pkg.tar.zst
- name: Install frontend dependencies
run: npm install

Expand All @@ -77,7 +86,9 @@ jobs:

- name: Build Windows
shell: msys2 {0}
run: make build
run: |
set MSYSTEM=MINGW64
make build
if: matrix.os == 'windows-latest'

- name: Test
Expand All @@ -86,7 +97,9 @@ jobs:

- name: Test Windows
shell: msys2 {0}
run: make test
run: |
set MSYSTEM=MINGW64
make test
if: matrix.os == 'windows-latest'

- name: Set pixlet version
Expand All @@ -95,9 +108,11 @@ jobs:
if: matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-latest'

- name: Set Windows pixlet version
id: windowsvars
id: windowsvars
shell: msys2 {0}
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
run: |
set MSYSTEM=MINGW64
echo ::set-output name=tag::${GITHUB_REF#refs/*/}
if: matrix.os == 'windows-latest'

- name: Build Release Linux
Expand All @@ -115,7 +130,9 @@ jobs:
- name: Build Release Windows
if: matrix.os == 'windows-latest'
shell: msys2 {0}
run: make release-windows
run: |
set MSYSTEM=MINGW64
make release-windows
env:
PIXLET_VERSION: ${{ steps.windowsvars.outputs.tag }}

Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/pull-request.yml
Expand Up @@ -45,12 +45,13 @@ jobs:
uses: msys2/setup-msys2@v2
if: matrix.os == 'windows-latest'
with:
msystem: mingw64
update: true
install: >-
make
curl
mingw-w64-x86_64-go
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-libwebp
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -63,6 +64,14 @@ jobs:
if: matrix.os == 'macos-latest'
run: brew install webp

- name: Install Windows dependencies
if: matrix.os == 'windows-latest'
shell: msys2 {0}
run: |
set MSYSTEM=MINGW64
curl -LO https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libwebp-1.2.4-4-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-x86_64-libwebp-1.2.4-4-any.pkg.tar.zst
- name: Install frontend dependencies
run: npm install

Expand All @@ -75,7 +84,9 @@ jobs:

- name: Build Windows
shell: msys2 {0}
run: make build
run: |
set MSYSTEM=MINGW64
make build
if: matrix.os == 'windows-latest'

- name: Test
Expand All @@ -84,5 +95,7 @@ jobs:

- name: Test Windows
shell: msys2 {0}
run: make test
run: |
set MSYSTEM=MINGW64
make test
if: matrix.os == 'windows-latest'

0 comments on commit ad48bb3

Please sign in to comment.