diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 5680a7ac..ccdf163a 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -120,6 +120,64 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.build_and_release_windows.outputs.upload_url }} + + build_and_release_debian: + strategy: + matrix: + os: [ubuntu-22.04, ubuntu-20.04] + runs-on: ${{ matrix.os }} + needs: build_and_release_windows + if: github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.START_BUILD == 'True' + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: 3.8 + + - name: Install Dependencies (apt) + run: | + sudo apt-get update -y + sudo DEBIAN_FRONTEND=noninteractive apt-get -y install zlib1g-dev libjpeg-dev devscripts python3-all-dev debhelper python3-pil python3-numpy dh-python + + - name: Install Dependencies (pip) + run: pip install -r requirements.txt + + - name: Clone Pillow 10.2.0 + run: git clone --branch=10.2.0 --depth=1 https://github.com/python-pillow/Pillow.git /tmp/pillow_checkout + + - name: Build Extension + run: env PIL_INCLUDE_DIR=/tmp/pillow_checkout/src/libImaging/ python setup.py build + + - name: Create .deb changelog + run: | + export VERSION=$(python3 setup.py --version) + export DATE=$(date -u +'%a, %d %b %Y %H:%M:%S %z') + envsubst < debian/changelog.in > debian/changelog + - name: Build .deb package + run: env DEB_BUILD_OPTIONS=nocheck debuild -i -us -uc -b -Zxz + + - name: List Debian Packages + run: ls -l ../*.deb + + - name: Get upload URL + run: 'echo "Upload URL: ${{ needs.build_and_release_windows.outputs.upload_url }}"' + + - name: Upload Debian Package Release Asset + id: upload_debian_package + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.build_and_release_windows.outputs.upload_url }} + asset_path: ../the-minecraft-overviewer_${{ env.VERSION }}-0_amd64.deb + asset_name: overviewer-v${{ env.VERSION }}-x86_64-${{ matrix.os }}.deb + asset_content_type: application/x-deb asset_path: ./overviewer-${{ env.VERSION }}-LINUX.tar.xz asset_name: overviewer-${{ env.VERSION }}-LINUX.tar.xz asset_content_type: application/x-xz