Add Ubuntu packaging script (#2936)

This commit is contained in:
Mm2PL 2021-07-17 13:28:45 +02:00 committed by GitHub
parent a509c7514c
commit 461443dbe5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 83 additions and 2 deletions

35
.CI/CreateUbuntuDeb.sh Executable file
View file

@ -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 <mm2pl@kotmisia.pl>
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"

View file

@ -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:

View file

@ -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