Merge pull request #294 from oynqr/msys2

Switch to msys2 for Windows builds
This commit is contained in:
Ezekiel Smith 2022-03-21 01:01:05 +11:00 committed by GitHub
commit 9841c0a63d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,9 +25,12 @@ jobs:
app_image: true app_image: true
- os: windows-2022 - os: windows-2022
qt_version: 5.15.2 name: "Windows-i686"
qt_host: windows msystem: mingw32
qt_arch: win32_mingw81
- os: windows-2022
name: "Windows-x86_64"
msystem: mingw64
- os: macos-11 - os: macos-11
qt_version: 5.12.12 qt_version: 5.12.12
@ -42,32 +45,24 @@ jobs:
BUILD_DIR: "build" BUILD_DIR: "build"
steps: steps:
- name: Install 32bit mingw on Windows
if: runner.os == 'Windows'
uses: egor-tensin/setup-mingw@v2
with:
platform: x86
- name: Install 32bit zlib via Strawberry on Windows
if: runner.os == 'Windows'
run: |
choco install strawberryperl -y --force --x86
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
submodules: 'true' submodules: 'true'
# We need to do this here because it inexplicably fails if we split the step - name: 'Setup MSYS2'
- name: Download and install OpenSSL libs on Windows
if: runner.os == 'Windows' if: runner.os == 'Windows'
run: | uses: msys2/setup-msys2@v2
python -m pip install --upgrade pip with:
python -m pip install aqtinstall==2.0.5 msystem: ${{ matrix.msystem }}
python -m aqt install-tool -O "${{ github.workspace }}\Qt\" windows desktop tools_openssl_x86 update: true
mkdir ${{ env.INSTALL_DIR }} install: >-
copy "${{ github.workspace }}\Qt\Tools\OpenSSL\Win_x86\bin\libssl-1_1.dll" "${{ github.workspace }}\${{ env.INSTALL_DIR }}\" git
copy "${{ github.workspace }}\Qt\Tools\OpenSSL\Win_x86\bin\libcrypto-1_1.dll" "${{ github.workspace }}\${{ env.INSTALL_DIR }}\" pacboy: >-
toolchain:p
cmake:p
ninja:p
qt5:p
- name: Set short version - name: Set short version
shell: bash shell: bash
@ -76,11 +71,13 @@ jobs:
echo "VERSION=$ver_short" >> $GITHUB_ENV echo "VERSION=$ver_short" >> $GITHUB_ENV
- name: Install OpenJDK - name: Install OpenJDK
uses: AdoptOpenJDK/install-jdk@v1 uses: actions/setup-java@v3
with: with:
version: '17' distribution: 'temurin'
java-version: '17'
- name: Cache Qt - name: Cache Qt
if: runner.os != 'Windows'
id: cache-qt id: cache-qt
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
@ -88,7 +85,7 @@ jobs:
key: ${{ runner.os }}-${{ matrix.qt_version }}-${{ matrix.qt_arch }}-qt_cache key: ${{ runner.os }}-${{ matrix.qt_version }}-${{ matrix.qt_arch }}-qt_cache
- name: Install Qt - name: Install Qt
if: runner.os != 'Linux' || matrix.app_image == true if: runner.os != 'Linux' && runner.os != 'Windows' || matrix.app_image == true
uses: jurplel/install-qt-action@v2 uses: jurplel/install-qt-action@v2
with: with:
version: ${{ matrix.qt_version }} version: ${{ matrix.qt_version }}
@ -104,6 +101,7 @@ jobs:
sudo apt-get -y install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5 sudo apt-get -y install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5
- name: Install Ninja - name: Install Ninja
if: runner.os != 'Windows'
uses: urkle/action-get-ninja@v1 uses: urkle/action-get-ninja@v1
- name: Download linuxdeploy family for AppImage on Linux - name: Download linuxdeploy family for AppImage on Linux
@ -120,7 +118,13 @@ jobs:
${{ github.workspace }}/.github/scripts/prepare_JREs.sh ${{ github.workspace }}/.github/scripts/prepare_JREs.sh
- name: Configure CMake - name: Configure CMake
if: runner.os != 'Linux' if: runner.os != 'Linux' && runner.os != 'Windows'
run: |
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -G Ninja
- name: Configure CMake on Windows
if: runner.os == 'Windows'
shell: msys2 {0}
run: | run: |
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -G Ninja cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -G Ninja
@ -130,11 +134,24 @@ jobs:
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DLauncher_PORTABLE=OFF -G Ninja cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DLauncher_PORTABLE=OFF -G Ninja
- name: Build - name: Build
if: runner.os != 'Windows'
run: |
cmake --build ${{ env.BUILD_DIR }}
- name: Build on Windows
if: runner.os == 'Windows'
shell: msys2 {0}
run: | run: |
cmake --build ${{ env.BUILD_DIR }} cmake --build ${{ env.BUILD_DIR }}
- name: Install - name: Install
if: runner.os != 'Linux' if: runner.os != 'Linux' && runner.os != 'Windows'
run: |
cmake --install ${{ env.BUILD_DIR }}
- name: Install on Windows
if: runner.os == 'Windows'
shell: msys2 {0}
run: | run: |
cmake --install ${{ env.BUILD_DIR }} cmake --install ${{ env.BUILD_DIR }}
@ -165,11 +182,6 @@ jobs:
./linuxdeploy-x86_64.AppImage --appdir ${{ env.INSTALL_DIR }} --output appimage --plugin qt -i ${{ env.INSTALL_DIR }}/usr/share/icons/hicolor/scalable/apps/org.polymc.PolyMC.svg ./linuxdeploy-x86_64.AppImage --appdir ${{ env.INSTALL_DIR }} --output appimage --plugin qt -i ${{ env.INSTALL_DIR }}/usr/share/icons/hicolor/scalable/apps/org.polymc.PolyMC.svg
- name: Run windeployqt
if: runner.os == 'Windows'
run: |
windeployqt --no-translations --no-system-d3d-compiler --no-opengl-sw "${{ env.INSTALL_DIR }}/polymc.exe"
- name: Run macdeployqt - name: Run macdeployqt
if: runner.os == 'macOS' if: runner.os == 'macOS'
run: | run: |
@ -207,11 +219,25 @@ jobs:
name: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}-x86_64.AppImage name: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}-x86_64.AppImage
path: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}-x86_64.AppImage path: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}-x86_64.AppImage
- name: Copy OpenSSL libs on Windows x86
if: runner.os == 'Windows' && matrix.msystem == 'mingw32'
shell: msys2 {0}
run: |
cp /mingw32/bin/libcrypto-1_1.dll ${{ env.INSTALL_DIR }}/
cp /mingw32/bin/libssl-1_1.dll ${{ env.INSTALL_DIR }}/
- name: Copy OpenSSL libs on Windows x86_64
if: runner.os == 'Windows' && matrix.msystem == 'mingw64'
shell: msys2 {0}
run: |
cp /mingw64/bin/libcrypto-1_1-x64.dll ${{ env.INSTALL_DIR }}/
cp /mingw64/bin/libssl-1_1-x64.dll ${{ env.INSTALL_DIR }}/
- name: Upload package for Windows - name: Upload package for Windows
if: runner.os == 'Windows' if: runner.os == 'Windows'
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }} name: PolyMC-${{ matrix.name }}-${{ env.VERSION }}-${{ inputs.build_type }}
path: ${{ env.INSTALL_DIR }}/** path: ${{ env.INSTALL_DIR }}/**
- name: Upload package for macOS - name: Upload package for macOS