From 35d1330fe2afc56932bd4d250d8bd14d3a980369 Mon Sep 17 00:00:00 2001 From: txtsd Date: Mon, 7 Feb 2022 01:05:50 +0530 Subject: [PATCH 01/11] Build AppImages for Linux Now builds windows and macOS builds, with windeployqt and macdeploqt. Also adds SHA to the build filenames. --- .github/workflows/build.yml | 87 +++++++++++++++++++++++++++++++------ 1 file changed, 74 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d7eeaf1d..f19da8d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,11 @@ jobs: qt_version: 5.12.8 qt_host: linux + - os: ubuntu-20.04 + qt_version: 5.15.2 + qt_host: linux + app_image: true + - os: windows-2022 qt_version: 5.15.2 qt_host: windows @@ -27,7 +32,9 @@ jobs: runs-on: ${{ matrix.os }} env: - MACOSX_DEPLOYMENT_TARGET: ${{matrix.macosx_deployment_target}} + MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx_deployment_target }} + INSTALL_DIR: "install" + BUILD_DIR: "build" steps: @@ -36,6 +43,11 @@ jobs: with: submodules: 'true' + - name: Install OpenJDK + uses: AdoptOpenJDK/install-jdk@v1 + with: + version: '8' + - name: Install OpenJDK uses: AdoptOpenJDK/install-jdk@v1 with: @@ -61,16 +73,52 @@ jobs: uses: urkle/action-get-ninja@v1 - name: Configure CMake + if: matrix.app_image != true run: | - cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Debug -G Ninja + cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=Debug -G Ninja + + - name: Configure CMake for AppImage + if: matrix.app_image == true + run: | + cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug -DLauncher_LAYOUT=lin-system -G Ninja - name: Build run: | - cmake --build build + cmake --build ${{ env.BUILD_DIR }} - name: Install + if: matrix.app_image != true run: | - cmake --install build + cmake --install ${{ env.BUILD_DIR }} + + - name: Install for AppImage + if: matrix.app_image == true + run: | + DESTDIR=${{ env.INSTALL_DIR }} cmake --install ${{ env.BUILD_DIR }} + + - name: Download linuxdeploy family + if: matrix.app_image == true + run: | + wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" + wget "https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage" + wget "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" + + - name: AppImage magic + if: matrix.app_image == true + shell: bash + run: | + export OUTPUT="PolyMC-${{ github.sha }}-x86_64.AppImage" + chmod +x linuxdeploy-*.AppImage + mkdir -p ${{ env.INSTALL_DIR }}/usr/lib/jvm/java-{8,17}-openjdk + cp -r /opt/hostedtoolcache/jdk-8-hotspot/1.0.0/x64/* ${{ env.INSTALL_DIR }}/usr/lib/jvm/java-8-openjdk + cp -r /opt/hostedtoolcache/jdk-17-hotspot/1.0.0/x64/* ${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk + LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_DIR }}/usr/lib:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-8-openjdk/jre/lib/amd64/server:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-8-openjdk/jre/lib/amd64:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk/lib/server:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk/lib" \ + ./linuxdeploy-x86_64.AppImage --appdir ${{ env.INSTALL_DIR }} --output appimage --plugin qt -d ${{ env.INSTALL_DIR }}/usr/share/applications/org.polymc.polymc.desktop -i ${{ env.INSTALL_DIR }}/usr/share/icons/hicolor/scalable/apps/org.polymc.PolyMC.svg + + - name: Run windeployqt + if: runner.os == 'Windows' + run: | + windeployqt "${{ env.INSTALL_DIR }}/polymc.exe" - name: Install OpenSSL libs if: runner.os == 'Windows' @@ -78,30 +126,43 @@ jobs: python -m pip install --upgrade pip python -m pip install aqtinstall==2.0.5 python -m aqt install-tool -O "${{ github.workspace }}\Qt\" windows desktop tools_openssl_x64 - copy "${{ github.workspace }}\Qt\Tools\OpenSSL\Win_x64\bin\libssl-1_1-x64.dll" "${{ github.workspace }}\install\" - copy "${{ github.workspace }}\Qt\Tools\OpenSSL\Win_x64\bin\libcrypto-1_1-x64.dll" "${{ github.workspace }}\install\" + copy "${{ github.workspace }}\Qt\Tools\OpenSSL\Win_x64\bin\libssl-1_1-x64.dll" "${{ github.workspace }}\${{ env.INSTALL_DIR }}\" + copy "${{ github.workspace }}\Qt\Tools\OpenSSL\Win_x64\bin\libcrypto-1_1-x64.dll" "${{ github.workspace }}\${{ env.INSTALL_DIR }}\" + + - name: Run macdeployqt + if: runner.os == 'macOS' + run: | + cd ${{ env.INSTALL_DIR }} + macdeployqt "PolyMC.app" -executable="PolyMC.app/Contents/MacOS/polymc" -always-overwrite - name: chmod binary on macOS if: runner.os == 'macOS' run: | - chmod +x "${{ github.workspace }}/install/PolyMC.app/Contents/MacOS/polymc" + chmod +x "${{ github.workspace }}/${{ env.INSTALL_DIR }}/PolyMC.app/Contents/MacOS/polymc" - name: tar bundle on macOS if: runner.os == 'macOS' run: | - cd install + cd ${{ env.INSTALL_DIR }} tar -czf ../polymc.tar.gz * - - name: Upload package for Linux and Windows - if: runner.os != 'macOS' + - name: Upload AppImage + if: matrix.app_image == true uses: actions/upload-artifact@v2 with: - name: polymc-${{ matrix.os }}-portable - path: install/** + name: PolyMC-${{ github.sha }}-x86_64.AppImage + path: PolyMC-${{ github.sha }}-x86_64.AppImage + + - name: Upload package for Linux and Windows + if: runner.os != 'macOS' && matrix.app_image != true + uses: actions/upload-artifact@v2 + with: + name: polymc-${{ runner.os }}-${{ github.sha }}-portable + path: ${{ env.INSTALL_DIR }}/** - name: Upload package for macOS if: runner.os == 'macOS' uses: actions/upload-artifact@v2 with: - name: polymc-${{ matrix.os }}-portable + name: polymc-${{ runner.os }}-${{ github.sha }}-portable path: polymc.tar.gz From 92a5b12bd9890eab3d5f6a9aa2fb24912a79ddf9 Mon Sep 17 00:00:00 2001 From: txtsd Date: Mon, 7 Feb 2022 09:55:42 +0530 Subject: [PATCH 02/11] Remove PrefersNonDefaultGPU --- program_info/org.polymc.PolyMC.desktop.in | 1 - 1 file changed, 1 deletion(-) diff --git a/program_info/org.polymc.PolyMC.desktop.in b/program_info/org.polymc.PolyMC.desktop.in index 5d982b38..2d9e7103 100644 --- a/program_info/org.polymc.PolyMC.desktop.in +++ b/program_info/org.polymc.PolyMC.desktop.in @@ -7,7 +7,6 @@ Terminal=false Exec=@Launcher_APP_BINARY_NAME@ StartupNotify=true Icon=org.polymc.PolyMC -PrefersNonDefaultGPU=true Categories=Game; Keywords=game;minecraft;launcher; StartupWMClass=PolyMC From e61e827eb93c71f3b0fe1e7e07b5ca4887587532 Mon Sep 17 00:00:00 2001 From: txtsd Date: Mon, 7 Feb 2022 15:48:47 +0530 Subject: [PATCH 03/11] Use Adoptium JREs --- .github/scripts/prepare_JREs.sh | 49 +++++++++++++++++++++++++++++++++ .github/workflows/build.yml | 15 +++++----- 2 files changed, 57 insertions(+), 7 deletions(-) create mode 100755 .github/scripts/prepare_JREs.sh diff --git a/.github/scripts/prepare_JREs.sh b/.github/scripts/prepare_JREs.sh new file mode 100755 index 00000000..1525fdb9 --- /dev/null +++ b/.github/scripts/prepare_JREs.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +URL_JDK8="https://api.adoptium.net/v3/binary/latest/8/ga/linux/x64/jre/hotspot/normal/eclipse" +URL_JDK17="https://api.adoptium.net/v3/binary/latest/17/ga/linux/x64/jre/hotspot/normal/eclipse" + +mkdir -p JREs +pushd JREs + +wget --content-disposition "$URL_JDK8" +wget --content-disposition "$URL_JDK17" + +for file in *; +do + mkdir temp + + # Handle OpenJDK17 archive + re='(OpenJDK17U-jre_x64_linux_hotspot_17.(.*).tar.gz)' + if [[ $file =~ $re ]]; + then + version=${BASH_REMATCH[2]} + version_edit=$(echo $version | sed -e 's/_/+/g') + dir_name=jdk-17.$version_edit-jre + echo $dir_name + mkdir jre17 + tar -xzf $file -C temp + pushd temp/$dir_name + cp -r . ../../jre17 + popd + + fi + + # Handle OpenJDK8 archive + re='(OpenJDK8U-jre_x64_linux_hotspot_8(.*).tar.gz)' + if [[ $file =~ $re ]]; + then + version=${BASH_REMATCH[2]} + version_edit=$(echo $version | sed -e 's/b/-b/g') + dir_name=jdk8$version_edit-jre + mkdir jre8 + tar -xzf $file -C temp + pushd temp/$dir_name + cp -r . ../../jre8 + popd + fi + + rm -rf temp +done + +popd diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f19da8d9..d2973b0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,11 +43,6 @@ jobs: with: submodules: 'true' - - name: Install OpenJDK - uses: AdoptOpenJDK/install-jdk@v1 - with: - version: '8' - - name: Install OpenJDK uses: AdoptOpenJDK/install-jdk@v1 with: @@ -103,6 +98,12 @@ jobs: wget "https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage" wget "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" + - name: Download JREs for AppImage + if: matrix.app_image == true + shell: bash + run: | + ${{ github.workspace }}/.github/scripts/prepare_JREs.sh + - name: AppImage magic if: matrix.app_image == true shell: bash @@ -110,8 +111,8 @@ jobs: export OUTPUT="PolyMC-${{ github.sha }}-x86_64.AppImage" chmod +x linuxdeploy-*.AppImage mkdir -p ${{ env.INSTALL_DIR }}/usr/lib/jvm/java-{8,17}-openjdk - cp -r /opt/hostedtoolcache/jdk-8-hotspot/1.0.0/x64/* ${{ env.INSTALL_DIR }}/usr/lib/jvm/java-8-openjdk - cp -r /opt/hostedtoolcache/jdk-17-hotspot/1.0.0/x64/* ${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk + cp -r ${{ github.workspace }}/JREs/jre8/* ${{ env.INSTALL_DIR }}/usr/lib/jvm/java-8-openjdk + cp -r ${{ github.workspace }}/JREs/jre17/* ${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_DIR }}/usr/lib:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-8-openjdk/jre/lib/amd64/server:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-8-openjdk/jre/lib/amd64:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk/lib/server:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk/lib" \ ./linuxdeploy-x86_64.AppImage --appdir ${{ env.INSTALL_DIR }} --output appimage --plugin qt -d ${{ env.INSTALL_DIR }}/usr/share/applications/org.polymc.polymc.desktop -i ${{ env.INSTALL_DIR }}/usr/share/icons/hicolor/scalable/apps/org.polymc.PolyMC.svg From 551d9c86ba624971a8b9362bb316d279dbf59363 Mon Sep 17 00:00:00 2001 From: txtsd Date: Mon, 7 Feb 2022 17:49:58 +0530 Subject: [PATCH 04/11] Implement PR suggestions --- .github/workflows/build.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d2973b0f..7b8f1968 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,6 +67,19 @@ jobs: - name: Install Ninja uses: urkle/action-get-ninja@v1 + - name: Download linuxdeploy family + if: matrix.app_image == true + run: | + wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" + wget "https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage" + wget "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" + + - name: Download JREs for AppImage + if: matrix.app_image == true + shell: bash + run: | + ${{ github.workspace }}/.github/scripts/prepare_JREs.sh + - name: Configure CMake if: matrix.app_image != true run: | @@ -91,20 +104,7 @@ jobs: run: | DESTDIR=${{ env.INSTALL_DIR }} cmake --install ${{ env.BUILD_DIR }} - - name: Download linuxdeploy family - if: matrix.app_image == true - run: | - wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" - wget "https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage" - wget "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" - - - name: Download JREs for AppImage - if: matrix.app_image == true - shell: bash - run: | - ${{ github.workspace }}/.github/scripts/prepare_JREs.sh - - - name: AppImage magic + - name: Bundle AppImage if: matrix.app_image == true shell: bash run: | From 94974851037f2c9ad313cfa72c65192be7c5ca64 Mon Sep 17 00:00:00 2001 From: txtsd Date: Mon, 7 Feb 2022 18:41:42 +0530 Subject: [PATCH 05/11] Implement more PR suggestions --- .github/workflows/build.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7b8f1968..600831c0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -109,11 +109,21 @@ jobs: shell: bash run: | export OUTPUT="PolyMC-${{ github.sha }}-x86_64.AppImage" + chmod +x linuxdeploy-*.AppImage + mkdir -p ${{ env.INSTALL_DIR }}/usr/lib/jvm/java-{8,17}-openjdk + cp -r ${{ github.workspace }}/JREs/jre8/* ${{ env.INSTALL_DIR }}/usr/lib/jvm/java-8-openjdk + cp -r ${{ github.workspace }}/JREs/jre17/* ${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk - LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_DIR }}/usr/lib:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-8-openjdk/jre/lib/amd64/server:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-8-openjdk/jre/lib/amd64:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk/lib/server:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk/lib" \ + + export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_DIR }}/usr/lib" + LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-8-openjdk/lib/amd64/server" + LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-8-openjdk/lib/amd64" + LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk/lib/server" + LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk/lib" + ./linuxdeploy-x86_64.AppImage --appdir ${{ env.INSTALL_DIR }} --output appimage --plugin qt -d ${{ env.INSTALL_DIR }}/usr/share/applications/org.polymc.polymc.desktop -i ${{ env.INSTALL_DIR }}/usr/share/icons/hicolor/scalable/apps/org.polymc.PolyMC.svg - name: Run windeployqt From 0ba61bb5903a22044decaa9390437e83be0dadd7 Mon Sep 17 00:00:00 2001 From: txtsd Date: Tue, 8 Feb 2022 08:55:52 +0530 Subject: [PATCH 06/11] Implement even more PR suggestions --- .github/scripts/prepare_JREs.sh | 38 +++++++++++++-------------------- .github/workflows/build.yml | 2 +- README.md | 5 +++++ 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/.github/scripts/prepare_JREs.sh b/.github/scripts/prepare_JREs.sh index 1525fdb9..b85e9c2f 100755 --- a/.github/scripts/prepare_JREs.sh +++ b/.github/scripts/prepare_JREs.sh @@ -13,33 +13,25 @@ for file in *; do mkdir temp - # Handle OpenJDK17 archive - re='(OpenJDK17U-jre_x64_linux_hotspot_17.(.*).tar.gz)' + re='(OpenJDK([[:digit:]]+)U-jre_x64_linux_hotspot_([[:digit:]]+)(.*).tar.gz)' if [[ $file =~ $re ]]; then - version=${BASH_REMATCH[2]} - version_edit=$(echo $version | sed -e 's/_/+/g') - dir_name=jdk-17.$version_edit-jre - echo $dir_name - mkdir jre17 + version_major=${BASH_REMATCH[2]} + version_trailing=${BASH_REMATCH[4]} + + if [ $version_major = 17 ]; + then + hyphen='-' + else + hyphen='' + fi + + version_edit=$(echo $version_trailing | sed -e 's/_/+/g' | sed -e 's/b/-b/g') + dir_name=jdk$hyphen$version_major$version_edit-jre + mkdir jre$version_major tar -xzf $file -C temp pushd temp/$dir_name - cp -r . ../../jre17 - popd - - fi - - # Handle OpenJDK8 archive - re='(OpenJDK8U-jre_x64_linux_hotspot_8(.*).tar.gz)' - if [[ $file =~ $re ]]; - then - version=${BASH_REMATCH[2]} - version_edit=$(echo $version | sed -e 's/b/-b/g') - dir_name=jdk8$version_edit-jre - mkdir jre8 - tar -xzf $file -C temp - pushd temp/$dir_name - cp -r . ../../jre8 + cp -r . ../../jre$version_major popd fi diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 600831c0..42661b09 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -124,7 +124,7 @@ jobs: LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk/lib/server" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk/lib" - ./linuxdeploy-x86_64.AppImage --appdir ${{ env.INSTALL_DIR }} --output appimage --plugin qt -d ${{ env.INSTALL_DIR }}/usr/share/applications/org.polymc.polymc.desktop -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' diff --git a/README.md b/README.md index 74d0493c..99f69b27 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,11 @@ sudo dnf install polymc MacOS currently does not have any packages. We are still working on setting up MacOS packaging. Meanwhile, you can [build](https://github.com/PolyMC/PolyMC/blob/develop/BUILD.md#macos) it for yourself. +## Development Builds + +There are per-commit development builds available [here](https://github.com/PolyMC/PolyMC/actions). These have debug information in the binaries, so their file sizes are relatively larger. +Builds are provided for Linux, AppImage on Linux, Windows, and macOS. + # Help & Support Feel free to create an issue if you need help. However, you might find it easier to ask in the Discord server. From 3eee38fedd50f41b5428fddbfb5583a61674f9b7 Mon Sep 17 00:00:00 2001 From: txtsd Date: Tue, 8 Feb 2022 18:44:30 +0530 Subject: [PATCH 07/11] Make 32bit Windows build instead --- .github/workflows/build.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42661b09..574c9c3e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: - os: windows-2022 qt_version: 5.15.2 qt_host: windows - qt_arch: win64_mingw81 + qt_arch: win32_mingw81 - os: macos-11 qt_version: 5.12.12 @@ -37,6 +37,16 @@ jobs: BUILD_DIR: "build" 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 uses: actions/checkout@v2 @@ -53,7 +63,7 @@ jobs: uses: actions/cache@v2 with: path: "${{ github.workspace }}/Qt/" - key: ${{ runner.os }}-${{ matrix.qt_version }}-qt_cache + key: ${{ runner.os }}-${{ matrix.qt_version }}-${{ matrix.qt_arch }}-qt_cache - name: Install Qt uses: jurplel/install-qt-action@v2 @@ -136,9 +146,9 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install aqtinstall==2.0.5 - python -m aqt install-tool -O "${{ github.workspace }}\Qt\" windows desktop tools_openssl_x64 - copy "${{ github.workspace }}\Qt\Tools\OpenSSL\Win_x64\bin\libssl-1_1-x64.dll" "${{ github.workspace }}\${{ env.INSTALL_DIR }}\" - copy "${{ github.workspace }}\Qt\Tools\OpenSSL\Win_x64\bin\libcrypto-1_1-x64.dll" "${{ github.workspace }}\${{ env.INSTALL_DIR }}\" + python -m aqt install-tool -O "${{ github.workspace }}\Qt\" windows desktop tools_openssl_x86 + copy "${{ github.workspace }}\Qt\Tools\OpenSSL\Win_x86\bin\libssl-1_1.dll" "${{ github.workspace }}\${{ env.INSTALL_DIR }}\" + copy "${{ github.workspace }}\Qt\Tools\OpenSSL\Win_x86\bin\libcrypto-1_1.dll" "${{ github.workspace }}\${{ env.INSTALL_DIR }}\" - name: Run macdeployqt if: runner.os == 'macOS' From eb692c2ee964d34c5aaa07f651e1f8bec3030a76 Mon Sep 17 00:00:00 2001 From: txtsd Date: Thu, 10 Feb 2022 20:58:31 +0530 Subject: [PATCH 08/11] Split OpenSSL step --- .github/workflows/build.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 574c9c3e..5f1d398d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,6 +48,13 @@ jobs: run: | choco install strawberryperl -y --force --x86 + - name: Download OpenSSL libs on Windows + if: runner.os == 'Windows' + run: | + python -m pip install --upgrade pip + python -m pip install aqtinstall==2.0.5 + python -m aqt install-tool -O "${{ github.workspace }}\Qt\" windows desktop tools_openssl_x86 + - name: Checkout uses: actions/checkout@v2 with: @@ -141,12 +148,9 @@ jobs: run: | windeployqt "${{ env.INSTALL_DIR }}/polymc.exe" - - name: Install OpenSSL libs + - name: Install OpenSSL libs on Windows if: runner.os == 'Windows' run: | - python -m pip install --upgrade pip - python -m pip install aqtinstall==2.0.5 - python -m aqt install-tool -O "${{ github.workspace }}\Qt\" windows desktop tools_openssl_x86 copy "${{ github.workspace }}\Qt\Tools\OpenSSL\Win_x86\bin\libssl-1_1.dll" "${{ github.workspace }}\${{ env.INSTALL_DIR }}\" copy "${{ github.workspace }}\Qt\Tools\OpenSSL\Win_x86\bin\libcrypto-1_1.dll" "${{ github.workspace }}\${{ env.INSTALL_DIR }}\" From 0e6e6a75211569ecad822a7dc7b44821833a600b Mon Sep 17 00:00:00 2001 From: txtsd Date: Thu, 10 Feb 2022 21:30:03 +0530 Subject: [PATCH 09/11] Remove generic Linux builds They don't necessarily run on all distros --- .github/workflows/build.yml | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f1d398d..fa2c831c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,10 +10,6 @@ jobs: matrix: include: - - os: ubuntu-20.04 - qt_version: 5.12.8 - qt_host: linux - - os: ubuntu-20.04 qt_version: 5.15.2 qt_host: linux @@ -85,25 +81,25 @@ jobs: uses: urkle/action-get-ninja@v1 - name: Download linuxdeploy family - if: matrix.app_image == true + if: runner.os == 'Linux' run: | wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" wget "https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage" wget "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" - - name: Download JREs for AppImage - if: matrix.app_image == true + - name: Download JREs for AppImage on Linux + if: runner.os == 'Linux' shell: bash run: | ${{ github.workspace }}/.github/scripts/prepare_JREs.sh - name: Configure CMake - if: matrix.app_image != true + if: runner.os != 'Linux' run: | cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=Debug -G Ninja - - name: Configure CMake for AppImage - if: matrix.app_image == true + - name: Configure CMake on Linux + if: runner.os == 'Linux' run: | cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug -DLauncher_LAYOUT=lin-system -G Ninja @@ -116,13 +112,13 @@ jobs: run: | cmake --install ${{ env.BUILD_DIR }} - - name: Install for AppImage - if: matrix.app_image == true + - name: Install for AppImage on Linux + if: runner.os == 'Linux' run: | DESTDIR=${{ env.INSTALL_DIR }} cmake --install ${{ env.BUILD_DIR }} - name: Bundle AppImage - if: matrix.app_image == true + if: runner.os == 'Linux' shell: bash run: | export OUTPUT="PolyMC-${{ github.sha }}-x86_64.AppImage" @@ -171,15 +167,15 @@ jobs: cd ${{ env.INSTALL_DIR }} tar -czf ../polymc.tar.gz * - - name: Upload AppImage - if: matrix.app_image == true + - name: Upload AppImage for Linux + if: runner.os == 'Linux' uses: actions/upload-artifact@v2 with: name: PolyMC-${{ github.sha }}-x86_64.AppImage path: PolyMC-${{ github.sha }}-x86_64.AppImage - - name: Upload package for Linux and Windows - if: runner.os != 'macOS' && matrix.app_image != true + - name: Upload package for Windows + if: runner.os == 'Windows' uses: actions/upload-artifact@v2 with: name: polymc-${{ runner.os }}-${{ github.sha }}-portable From 33d369d78c5773ac2a9f9f0d9a7defcddc8f28f5 Mon Sep 17 00:00:00 2001 From: txtsd Date: Thu, 10 Feb 2022 22:34:14 +0530 Subject: [PATCH 10/11] Add missing deploy flags --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa2c831c..5c78e93e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -142,7 +142,7 @@ jobs: - name: Run windeployqt if: runner.os == 'Windows' run: | - windeployqt "${{ env.INSTALL_DIR }}/polymc.exe" + windeployqt --no-translations "${{ env.INSTALL_DIR }}/polymc.exe" - name: Install OpenSSL libs on Windows if: runner.os == 'Windows' @@ -154,7 +154,7 @@ jobs: if: runner.os == 'macOS' run: | cd ${{ env.INSTALL_DIR }} - macdeployqt "PolyMC.app" -executable="PolyMC.app/Contents/MacOS/polymc" -always-overwrite + macdeployqt "PolyMC.app" -executable="PolyMC.app/Contents/MacOS/polymc" -always-overwrite -use-debug-libs - name: chmod binary on macOS if: runner.os == 'macOS' From b9be8d08d2719aeafbb8f51327c4c1fa77cfd9db Mon Sep 17 00:00:00 2001 From: txtsd Date: Thu, 10 Feb 2022 23:26:16 +0530 Subject: [PATCH 11/11] Remove superfluous variable --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c78e93e..eda7479a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,6 @@ jobs: - os: ubuntu-20.04 qt_version: 5.15.2 qt_host: linux - app_image: true - os: windows-2022 qt_version: 5.15.2 @@ -108,7 +107,7 @@ jobs: cmake --build ${{ env.BUILD_DIR }} - name: Install - if: matrix.app_image != true + if: runner.os != 'Linux' run: | cmake --install ${{ env.BUILD_DIR }}