From 95182ed74b3cea178a113eb64d62cf9d5086ad74 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sun, 20 Mar 2022 15:11:43 +0100 Subject: [PATCH 1/5] chore: bump version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7537703c..52170460 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,7 @@ set(Launcher_HELP_URL "https://polymc.org/wiki/%1" CACHE STRING "URL (with arg % ######## Set version numbers ######## set(Launcher_VERSION_MAJOR 1) set(Launcher_VERSION_MINOR 1) -set(Launcher_VERSION_HOTFIX 0) +set(Launcher_VERSION_HOTFIX 1) # Build number set(Launcher_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number.") From f3a244e90a528196ce8c0d2c13f747d9fb4dbcf9 Mon Sep 17 00:00:00 2001 From: flow Date: Tue, 22 Mar 2022 19:37:10 -0300 Subject: [PATCH 2/5] fix: fix skipping one on file counting in mod version parse --- launcher/modplatform/modrinth/ModrinthPackIndex.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp index 9581ca04..992d6657 100644 --- a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp +++ b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp @@ -55,7 +55,8 @@ void Modrinth::loadIndexedPackVersions(Modrinth::IndexedPack & pack, QJsonArray // Find correct file (needed in cases where one version may have multiple files) // Will default to the last one if there's no primary (though I think Modrinth requires that // at least one file is primary, idk) - while (i < files.count()){ + // NOTE: files.count() is 1-indexed, so we need to subtract 1 to become 0-indexed + while (i < files.count() - 1){ auto parent = files[i].toObject(); auto fileName = Json::requireString(parent, "filename"); @@ -77,6 +78,7 @@ void Modrinth::loadIndexedPackVersions(Modrinth::IndexedPack & pack, QJsonArray i++; } + auto parent = files[i].toObject(); if(parent.contains("url")) { file.downloadUrl = Json::requireString(parent, "url"); From 51de84407f486adc8c13c4d9c2b72a75bd8adf69 Mon Sep 17 00:00:00 2001 From: Philipp David Date: Wed, 23 Mar 2022 11:36:28 +0100 Subject: [PATCH 3/5] Create vendored tarball on release --- .github/workflows/trigger_release.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/trigger_release.yml b/.github/workflows/trigger_release.yml index b487e731..a1d61d05 100644 --- a/.github/workflows/trigger_release.yml +++ b/.github/workflows/trigger_release.yml @@ -39,6 +39,12 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: 'true' + path: 'PolyMC-source' + - name: Download artifacts uses: actions/download-artifact@v2 @@ -49,11 +55,14 @@ jobs: - name: Package artifacts properly run: | + mv ${{ github.workspace }}/PolyMC-source PolyMC-${{ env.VERSION }} mv PolyMC-Linux*/PolyMC.tar.gz PolyMC-Linux-${{ env.VERSION }}.tar.gz mv PolyMC-*.AppImage/PolyMC-*.AppImage PolyMC-Linux-${{ env.VERSION }}-x86_64.AppImage mv PolyMC-Windows* PolyMC-Windows-${{ env.VERSION }} mv PolyMC-macOS*/PolyMC.tar.gz PolyMC-macOS-${{ env.VERSION }}.tar.gz + tar -czf PolyMC-${{ env.VERSION }}.tar.gz PolyMC-${{ env.VERSION }} + cd PolyMC-Windows-${{ env.VERSION }} zip -r -9 ../PolyMC-Windows-${{ env.VERSION }}.zip * cd .. @@ -97,3 +106,13 @@ jobs: asset_name: PolyMC-macOS-${{ env.VERSION }}.tar.gz asset_path: PolyMC-macOS-${{ env.VERSION }}.tar.gz asset_content_type: application/gzip + + - name: Upload vendored source tarball + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create_release.outputs.upload_url }} + asset_name: PolyMC-${{ env.VERSION }}.tar.gz + asset_path: PolyMC-${{ env.VERSION }}.tar.gz + asset_content_type: application/gzip From 471ea680a5aea20385667635d5a3695841bfa194 Mon Sep 17 00:00:00 2001 From: Philipp David Date: Wed, 23 Mar 2022 13:33:18 +0100 Subject: [PATCH 4/5] Update used actions and cleanup release flow --- .github/workflows/backport.yml | 4 +- .github/workflows/build.yml | 12 +-- .github/workflows/trigger_release.yml | 118 ++++++++------------------ 3 files changed, 44 insertions(+), 90 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index e1a7cffa..fa287a2c 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -9,7 +9,9 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v1 + uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Backport PR by cherry-pick-ing uses: Nathanmalnoury/gh-backport-action@master with: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4aa316f4..3e8681c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,7 +58,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: 'true' @@ -91,7 +91,7 @@ jobs: - name: Cache Qt if: runner.os != 'Windows' id: cache-qt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: "${{ github.workspace }}/Qt/" key: ${{ runner.os }}-${{ matrix.qt_version }}-${{ matrix.qt_arch }}-qt_cache @@ -226,14 +226,14 @@ jobs: - name: Upload Linux tar.gz if: runner.os == 'Linux' && matrix.app_image != true - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }} path: PolyMC.tar.gz - name: Upload AppImage for Linux if: matrix.app_image == true - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}-x86_64.AppImage path: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}-x86_64.AppImage @@ -254,14 +254,14 @@ jobs: - name: Upload package for Windows if: runner.os == 'Windows' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: PolyMC-${{ matrix.name }}-${{ env.VERSION }}-${{ inputs.build_type }} path: ${{ env.INSTALL_DIR }}/** - name: Upload package for macOS if: runner.os == 'macOS' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }} path: PolyMC.tar.gz diff --git a/.github/workflows/trigger_release.yml b/.github/workflows/trigger_release.yml index a1d61d05..149cb632 100644 --- a/.github/workflows/trigger_release.yml +++ b/.github/workflows/trigger_release.yml @@ -19,10 +19,36 @@ jobs: outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: 'true' + path: 'PolyMC-source' + - name: Download artifacts + uses: actions/download-artifact@v3 - name: Grab and store version run: | tag_name=$(echo ${{ github.ref }} | grep -oE "[^/]+$") echo "VERSION=$tag_name" >> $GITHUB_ENV + - name: Package artifacts properly + run: | + mv ${{ github.workspace }}/PolyMC-source PolyMC-${{ env.VERSION }} + mv PolyMC-Linux*/PolyMC.tar.gz PolyMC-Linux-${{ env.VERSION }}.tar.gz + mv PolyMC-*.AppImage/PolyMC-*.AppImage PolyMC-Linux-${{ env.VERSION }}-x86_64.AppImage + mv PolyMC-macOS*/PolyMC.tar.gz PolyMC-macOS-${{ env.VERSION }}.tar.gz + + tar -czf PolyMC-${{ env.VERSION }}.tar.gz PolyMC-${{ env.VERSION }} + + for d in PolyMC-Windows-*; do + cd "${d}" || continue + ARCH="$(echo -n ${d} | cut -d '-' -f 3)" + PORT="$(echo -n ${d} | grep -o portable || true)" + NAME="PolyMC-Windows-${ARCH}" + test -z "${PORT}" || NAME="${NAME}-portable" + zip -r -9 "../${NAME}-${{ env.VERSION }}.zip" * + cd .. + done + - name: Create release id: create_release uses: softprops/action-gh-release@v1 @@ -33,86 +59,12 @@ jobs: name: PolyMC ${{ env.VERSION }} draft: true prerelease: false - - upload_release: - needs: create_release - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v2 - with: - submodules: 'true' - path: 'PolyMC-source' - - - name: Download artifacts - uses: actions/download-artifact@v2 - - - name: Grab and store version - run: | - tag_name=$(echo ${{ github.ref }} | grep -oE "[^/]+$") - echo "VERSION=$tag_name" >> $GITHUB_ENV - - - name: Package artifacts properly - run: | - mv ${{ github.workspace }}/PolyMC-source PolyMC-${{ env.VERSION }} - mv PolyMC-Linux*/PolyMC.tar.gz PolyMC-Linux-${{ env.VERSION }}.tar.gz - mv PolyMC-*.AppImage/PolyMC-*.AppImage PolyMC-Linux-${{ env.VERSION }}-x86_64.AppImage - mv PolyMC-Windows* PolyMC-Windows-${{ env.VERSION }} - mv PolyMC-macOS*/PolyMC.tar.gz PolyMC-macOS-${{ env.VERSION }}.tar.gz - - tar -czf PolyMC-${{ env.VERSION }}.tar.gz PolyMC-${{ env.VERSION }} - - cd PolyMC-Windows-${{ env.VERSION }} - zip -r -9 ../PolyMC-Windows-${{ env.VERSION }}.zip * - cd .. - - - name: Upload Linux asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_name: PolyMC-Linux-${{ env.VERSION }}.tar.gz - asset_path: PolyMC-Linux-${{ env.VERSION }}.tar.gz - asset_content_type: application/gzip - - - name: Upload Linux AppImage asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_name: PolyMC-Linux-${{ env.VERSION }}-x86_64.AppImage - asset_path: PolyMC-Linux-${{ env.VERSION }}-x86_64.AppImage - asset_content_type: application/x-executable - - - name: Upload Windows asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_name: PolyMC-Windows-${{ env.VERSION }}.zip - asset_path: PolyMC-Windows-${{ env.VERSION }}.zip - asset_content_type: application/zip - - - name: Upload macOS asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_name: PolyMC-macOS-${{ env.VERSION }}.tar.gz - asset_path: PolyMC-macOS-${{ env.VERSION }}.tar.gz - asset_content_type: application/gzip - - - name: Upload vendored source tarball - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_name: PolyMC-${{ env.VERSION }}.tar.gz - asset_path: PolyMC-${{ env.VERSION }}.tar.gz - asset_content_type: application/gzip + files: | + PolyMC-Linux-${{ env.VERSION }}.tar.gz + PolyMC-Linux-${{ env.VERSION }}-x86_64.AppImage + PolyMC-Windows-i686-${{ env.VERSION }}.zip + PolyMC-Windows-i686-portable-${{ env.VERSION }}.zip + PolyMC-Windows-x86_64-${{ env.VERSION }}.zip + PolyMC-Windows-x86_64-portable-${{ env.VERSION }}.zip + PolyMC-macOS-${{ env.VERSION }}.tar.gz + PolyMC-${{ env.VERSION }}.tar.gz From 54d2c91320e446776ccc36d13c171168676222fb Mon Sep 17 00:00:00 2001 From: DioEgizio <83089242+DioEgizio@users.noreply.github.com> Date: Fri, 25 Mar 2022 13:13:50 +0100 Subject: [PATCH 5/5] bring back portable linux builds --- .github/workflows/build.yml | 38 ++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e8681c9..b011a779 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,12 @@ jobs: qt_version: 5.12.8 qt_host: linux + - os: ubuntu-20.04 + name: Linux-Portable + qt_version: 5.12.8 + qt_host: linux + portable: true + - os: ubuntu-20.04 qt_version: 5.15.2 qt_host: linux @@ -140,7 +146,6 @@ jobs: run: | cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DLauncher_PORTABLE=OFF -G Ninja - - name: Configure CMake on Windows portable if: runner.os == 'Windows' && matrix.portable == true shell: msys2 {0} @@ -148,10 +153,15 @@ jobs: cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -G Ninja - name: Configure CMake on Linux - if: runner.os == 'Linux' + if: runner.os == 'Linux' && matrix.portable != true run: | cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DLauncher_PORTABLE=OFF -G Ninja + - name: Configure CMake on Linux Portable + if: runner.os == 'Linux' && matrix.portable == true + run: | + cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -G Ninja + - name: Build if: runner.os != 'Windows' run: | @@ -175,10 +185,15 @@ jobs: cmake --install ${{ env.BUILD_DIR }} - name: Install on Linux - if: runner.os == 'Linux' + if: runner.os == 'Linux' && matrix.portable != true run: | DESTDIR=${{ env.INSTALL_DIR }} cmake --install ${{ env.BUILD_DIR }} + - name: Install on Linux portable + if: runner.os == 'Linux' && matrix.portable == true + run: | + cmake --install ${{ env.BUILD_DIR }} + - name: Bundle AppImage if: matrix.app_image == true shell: bash @@ -219,18 +234,31 @@ jobs: tar -czf ../PolyMC.tar.gz * - name: tar on Linux - if: runner.os == 'Linux' && matrix.app_image != true + if: runner.os == 'Linux' && matrix.app_image != true && matrix.portable != true run: | cd ${{ env.INSTALL_DIR }} tar -czf ../PolyMC.tar.gz * + - name: tar on Linux portable + if: runner.os == 'Linux' && matrix.app_image != true && matrix.portable == true + run: | + cd ${{ env.INSTALL_DIR }} + tar -czf ../PolyMC-portable.tar.gz * + - name: Upload Linux tar.gz - if: runner.os == 'Linux' && matrix.app_image != true + if: runner.os == 'Linux' && matrix.app_image != true && matrix.portable != true uses: actions/upload-artifact@v3 with: name: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }} path: PolyMC.tar.gz + - name: Upload Linux Portable tar.gz + if: runner.os == 'Linux' && matrix.app_image != true && matrix.portable == true + uses: actions/upload-artifact@v3 + with: + name: PolyMC-${{ runner.os }}-Portable-${{ env.VERSION }}-${{ inputs.build_type }} + path: PolyMC-portable.tar.gz + - name: Upload AppImage for Linux if: matrix.app_image == true uses: actions/upload-artifact@v3