From 461443dbe517c8ea15b222350d1c7f3c6a54954f Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Sat, 17 Jul 2021 13:28:45 +0200 Subject: [PATCH] Add Ubuntu packaging script (#2936) --- .CI/CreateUbuntuDeb.sh | 35 ++++++++++++++++++++++++++ .github/workflows/build.yml | 49 +++++++++++++++++++++++++++++++++++-- CHANGELOG.md | 1 + 3 files changed, 83 insertions(+), 2 deletions(-) create mode 100755 .CI/CreateUbuntuDeb.sh diff --git a/.CI/CreateUbuntuDeb.sh b/.CI/CreateUbuntuDeb.sh new file mode 100755 index 000000000..9a90ca32f --- /dev/null +++ b/.CI/CreateUbuntuDeb.sh @@ -0,0 +1,35 @@ +#!/bin/sh +set -e + +if [ ! -f ./bin/chatterino ] || [ ! -x ./bin/chatterino ]; then + echo "ERROR: No chatterino binary file found. This script must be run in the build folder, and chatterino must be built first." + exit 1 +fi + +chatterino_version=$(git describe | cut -c 2-) +echo "Found Chatterino version $chatterino_version via git" + +rm -vrf "./package" || true # delete any old packaging dir + +# create ./package/ from scratch +mkdir package/DEBIAN -p +packaging_dir="$(realpath ./package)" + +echo "Making control file" +cat >> "$packaging_dir/DEBIAN/control" << EOF +Package: chatterino +Section: net +Priority: optional +Architecture: amd64 +Maintainer: Mm2PL +Description: Testing out chatterino as a Ubuntu package +Depends: libc6, libqt5concurrent5, libqt5core5a, libqt5dbus5, libqt5gui5, libqt5multimedia5, libqt5network5, libqt5svg5, libqt5widgets5, libssl1.1, libstdc++6 +EOF +echo "Version: $chatterino_version" >> "$packaging_dir/DEBIAN/control" + +echo "Running make install in package dir" +DESTDIR="$packaging_dir" make INSTALL_ROOT="$packaging_dir" -j"$(nproc)" install; find "$packaging_dir/" +echo "" + +echo "Building package..." +dpkg-deb --build "$packaging_dir" "Chatterino.deb" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef3e397a2..5fc9497b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,6 +41,7 @@ jobs: - uses: actions/checkout@v2.3.4 with: submodules: true + fetch-depth: 0 # allows for tags access - name: Cache Qt id: cache-qt @@ -161,20 +162,34 @@ jobs: make -j8 shell: bash - - name: Package (Ubuntu) + - name: Package - AppImage (Ubuntu) if: startsWith(matrix.os, 'ubuntu') run: | cd build sh ./../.CI/CreateAppImage.sh shell: bash - - name: Upload artifact (Ubuntu) + - name: Package - .deb (Ubuntu) + if: startsWith(matrix.os, 'ubuntu') + run: | + cd build + sh ./../.CI/CreateUbuntuDeb.sh + shell: bash + + - name: Upload artifact - AppImage (Ubuntu) if: startsWith(matrix.os, 'ubuntu') uses: actions/upload-artifact@v2.2.4 with: name: Chatterino-x86_64-${{ matrix.qt-version }}-${{ matrix.build-system }}.AppImage path: build/Chatterino-x86_64.AppImage + - name: Upload artifact - .deb (Ubuntu) + if: startsWith(matrix.os, 'ubuntu') + uses: actions/upload-artifact@v2.2.4 + with: + name: Chatterino-${{ matrix.qt-version }}-${{ matrix.build-system }}.deb + path: build/Chatterino.deb + # MACOS - name: Install dependencies (MacOS) if: startsWith(matrix.os, 'macos') @@ -259,6 +274,16 @@ jobs: name: Chatterino-x86_64-5.15.2-cmake.AppImage path: linux-cmake/ + - uses: actions/download-artifact@v2.0.10 + with: + name: Chatterino-5.15.2-qmake.deb + path: ubuntu/ + + - uses: actions/download-artifact@v2.0.10 + with: + name: Chatterino-5.15.2-cmake.deb + path: ubuntu-cmake/ + - uses: actions/download-artifact@v2.0.10 with: name: chatterino-osx-5.15.2-qmake.dmg @@ -316,6 +341,26 @@ jobs: asset_name: test-cmake-Chatterino-x86_64.AppImage asset_content_type: application/x-executable + - name: Upload release asset (Ubuntu .deb) + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./ubuntu/Chatterino.deb + asset_name: Chatterino-x86_64.deb + asset_content_type: application/vnd.debian.binary-package + + - name: Upload release asset (Ubuntu .deb) CMake + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./ubuntu-cmake/Chatterino.deb + asset_name: test-cmake-Chatterino-x86_64.deb + asset_content_type: application/vnd.debian.binary-package + - name: Upload release asset (MacOS) uses: actions/upload-release-asset@v1.0.2 env: diff --git a/CHANGELOG.md b/CHANGELOG.md index 79aa0f270..4f944fb12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unversioned - Bugfix: Fixed "smiley" emotes being unable to be "Tabbed" with autocompletion, introduced in v2.3.3. (#3010) +- Dev: Ubuntu packages are now available (#2936) ## 2.3.3