From e90b5b88161abc73e9be85a8da66739ce6156d30 Mon Sep 17 00:00:00 2001 From: T-256 <132141463+T-256@users.noreply.github.com> Date: Tue, 2 Jan 2024 20:34:07 +0330 Subject: [PATCH 1/2] Windows: added `i686` building target --- .github/workflows/build-win.yaml | 32 +++++++++++++++++++------------- win/dll2lib.bat | 2 +- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-win.yaml b/.github/workflows/build-win.yaml index b3b3e7fa..f9030382 100644 --- a/.github/workflows/build-win.yaml +++ b/.github/workflows/build-win.yaml @@ -21,6 +21,11 @@ jobs: build-windows: name: Build windows binaries runs-on: windows-2019 + strategy: + matrix: + include: + - { sys: mingw64, env: x86_64 } + - { sys: mingw32, env: i686 } steps: - name: configure Pagefile uses: al-cheb/configure-pagefile-action@v1.3 @@ -41,20 +46,21 @@ jobs: name: Install msys with: update: true + msystem: ${{ matrix.sys }} install: >- git patch unzip - mingw-w64-x86_64-brotli - mingw-w64-x86_64-libidn2 - mingw-w64-x86_64-zstd - mingw-w64-x86_64-nghttp2 - mingw-w64-x86_64-zlib - mingw-w64-x86_64-make - mingw-w64-x86_64-cmake - mingw-w64-x86_64-nasm - mingw-w64-x86_64-gcc - mingw-w64-x86_64-go + mingw-w64-${{ matrix.env }}-brotli + mingw-w64-${{ matrix.env }}-libidn2 + mingw-w64-${{ matrix.env }}-zstd + mingw-w64-${{ matrix.env }}-nghttp2 + mingw-w64-${{ matrix.env }}-zlib + mingw-w64-${{ matrix.env }}-make + mingw-w64-${{ matrix.env }}-cmake + mingw-w64-${{ matrix.env }}-nasm + mingw-w64-${{ matrix.env }}-gcc + mingw-w64-${{ matrix.env }}-go - name: Copy and patch shell: msys2 {0} @@ -66,15 +72,15 @@ jobs: - uses: ilammy/msvc-dev-cmd@v1 - name: Generate lib files - run: ./win/dll2lib.bat 64 build\dist\libcurl.dll + run: ./win/dll2lib.bat ${{ matrix.env }} build\dist\libcurl.dll - name: Build tarball shell: msys2 {0} - run: tar cvzf libcurl-impersonate-${{ github.ref_name }}.x86_64-win32.tar.gz -C ./build/dist . + run: tar cvzf libcurl-impersonate-${{ github.ref_name }}.${{ matrix.env }}-win32.tar.gz -C ./build/dist . - name: Upload release files uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: prerelease: true - files: libcurl-impersonate-${{ github.ref_name }}.x86_64-win32.tar.gz + files: libcurl-impersonate-${{ github.ref_name }}.${{ matrix.env }}-win32.tar.gz diff --git a/win/dll2lib.bat b/win/dll2lib.bat index 1886a616..7083c101 100644 --- a/win/dll2lib.bat +++ b/win/dll2lib.bat @@ -9,7 +9,7 @@ REM Requires 'dumpbin' and 'lib' in PATH - run from VS developer prompt. REM REM Script inspired by http://stackoverflow.com/questions/9946322/how-to-generate-an-import-library-lib-file-from-a-dll SETLOCAL -if "%1"=="32" (set machine=x86) else (set machine=x64) +if "%1"=="i686" (set machine=x86) else (set machine=x64) set dll_file=%2 set dll_file_no_ext=%dll_file:~0,-4% set exports_file=%dll_file_no_ext%-exports.txt From de77fdd48b89612bf0479e6c2398ab3643b45c75 Mon Sep 17 00:00:00 2001 From: T-256 <132141463+T-256@users.noreply.github.com> Date: Tue, 2 Jan 2024 21:51:56 +0330 Subject: [PATCH 2/2] on PR: `github.head_ref` --- .github/workflows/build-win.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-win.yaml b/.github/workflows/build-win.yaml index f9030382..1c386a5e 100644 --- a/.github/workflows/build-win.yaml +++ b/.github/workflows/build-win.yaml @@ -76,11 +76,11 @@ jobs: - name: Build tarball shell: msys2 {0} - run: tar cvzf libcurl-impersonate-${{ github.ref_name }}.${{ matrix.env }}-win32.tar.gz -C ./build/dist . + run: tar cvzf libcurl-impersonate-${{ github.head_ref || github.ref_name }}.${{ matrix.env }}-win32.tar.gz -C ./build/dist . - name: Upload release files uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: prerelease: true - files: libcurl-impersonate-${{ github.ref_name }}.${{ matrix.env }}-win32.tar.gz + files: libcurl-impersonate-${{ github.head_ref || github.ref_name }}.${{ matrix.env }}-win32.tar.gz