diff options
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/backport.yml | 19 | ||||
-rw-r--r-- | .github/workflows/build.yml | 161 | ||||
-rw-r--r-- | .github/workflows/trigger_builds.yml | 10 | ||||
-rw-r--r-- | .github/workflows/trigger_release.yml | 93 |
4 files changed, 172 insertions, 111 deletions
diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 00000000..fa287a2c --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,19 @@ +name: Backport PR to stable +on: + pull_request: + branches: [ develop ] + types: [ closed ] +jobs: + release_pull_request: + if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'backport') + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Backport PR by cherry-pick-ing + uses: Nathanmalnoury/gh-backport-action@master + with: + pr_branch: 'stable' + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5797e95..b011a779 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,14 +20,35 @@ jobs: 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 app_image: true - os: windows-2022 - qt_version: 5.15.2 - qt_host: windows - qt_arch: win32_mingw81 + name: "Windows-i686" + msystem: mingw32 + portable: false + + - os: windows-2022 + name: "Windows-x86_64" + msystem: mingw64 + portable: false + + - os: windows-2022 + name: "Windows-i686-portable" + msystem: mingw32 + portable: true + + - os: windows-2022 + name: "Windows-x86_64-portable" + msystem: mingw64 + portable: true - os: macos-11 qt_version: 5.12.12 @@ -42,32 +63,24 @@ 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 + uses: actions/checkout@v3 with: submodules: 'true' - # We need to do this here because it inexplicably fails if we split the step - - name: Download and install OpenSSL libs on Windows + - name: 'Setup MSYS2' 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 - mkdir ${{ env.INSTALL_DIR }} - 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 }}\" + uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.msystem }} + update: true + install: >- + git + pacboy: >- + toolchain:p + cmake:p + ninja:p + qt5:p - name: Set short version shell: bash @@ -76,19 +89,21 @@ jobs: echo "VERSION=$ver_short" >> $GITHUB_ENV - name: Install OpenJDK - uses: AdoptOpenJDK/install-jdk@v1 + uses: actions/setup-java@v3 with: - version: '17' + distribution: 'temurin' + java-version: '17' - 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 - 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 with: version: ${{ matrix.qt_version }} @@ -104,6 +119,7 @@ jobs: sudo apt-get -y install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5 - name: Install Ninja + if: runner.os != 'Windows' uses: urkle/action-get-ninja@v1 - name: Download linuxdeploy family for AppImage on Linux @@ -120,29 +136,64 @@ jobs: ${{ github.workspace }}/.github/scripts/prepare_JREs.sh - 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' && matrix.portable != true + shell: msys2 {0} + 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} + 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 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: | + cmake --build ${{ env.BUILD_DIR }} + + - name: Build on Windows + if: runner.os == 'Windows' + shell: msys2 {0} run: | cmake --build ${{ env.BUILD_DIR }} - 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: | 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 @@ -165,11 +216,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 - - 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 if: runner.os == 'macOS' run: | @@ -188,35 +234,62 @@ 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 - uses: actions/upload-artifact@v2 + 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@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 + - 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 if: runner.os == 'Windows' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: - name: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }} + 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_builds.yml b/.github/workflows/trigger_builds.yml index 1561b9d6..3ec6bb95 100644 --- a/.github/workflows/trigger_builds.yml +++ b/.github/workflows/trigger_builds.yml @@ -9,12 +9,16 @@ on: - '**/LICENSE' - 'flake.lock' - '**.nix' + - 'packages/**' + - '.github/ISSUE_TEMPLATE/**' pull_request: paths-ignore: - '**.md' - '**/LICENSE' - 'flake.lock' - '**.nix' + - 'packages/**' + - '.github/ISSUE_TEMPLATE/**' workflow_dispatch: jobs: @@ -24,9 +28,3 @@ jobs: uses: ./.github/workflows/build.yml with: build_type: Debug - - build_release: - name: Build Release - uses: ./.github/workflows/build.yml - with: - build_type: Release diff --git a/.github/workflows/trigger_release.yml b/.github/workflows/trigger_release.yml index b487e731..149cb632 100644 --- a/.github/workflows/trigger_release.yml +++ b/.github/workflows/trigger_release.yml @@ -19,81 +19,52 @@ jobs: outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - - name: Grab and store version - run: | - tag_name=$(echo ${{ github.ref }} | grep -oE "[^/]+$") - echo "VERSION=$tag_name" >> $GITHUB_ENV - - name: Create release - id: create_release - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout + uses: actions/checkout@v3 with: - tag_name: ${{ github.ref }} - name: PolyMC ${{ env.VERSION }} - draft: true - prerelease: false - - upload_release: - needs: create_release - runs-on: ubuntu-latest - steps: - + submodules: 'true' + path: 'PolyMC-source' - name: Download artifacts - uses: actions/download-artifact@v2 - + 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-Windows* PolyMC-Windows-${{ env.VERSION }} mv PolyMC-macOS*/PolyMC.tar.gz PolyMC-macOS-${{ env.VERSION }}.tar.gz - cd PolyMC-Windows-${{ env.VERSION }} - zip -r -9 ../PolyMC-Windows-${{ env.VERSION }}.zip * - cd .. + tar -czf PolyMC-${{ env.VERSION }}.tar.gz PolyMC-${{ env.VERSION }} - - 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 + 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: Upload macOS asset - uses: actions/upload-release-asset@v1 + - name: Create release + id: create_release + uses: softprops/action-gh-release@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 + tag_name: ${{ github.ref }} + name: PolyMC ${{ env.VERSION }} + draft: true + prerelease: false + 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 |