Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Chatterino/chatterino2 into danke…
Browse files Browse the repository at this point in the history
…rino
  • Loading branch information
Mm2PL committed Feb 18, 2024
2 parents cad835e + ffa63f0 commit c7c0403
Show file tree
Hide file tree
Showing 94 changed files with 3,330 additions and 889 deletions.
11 changes: 4 additions & 7 deletions .CI/CreateUbuntuDeb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@ deb_path="Chatterino-ubuntu-${ubuntu_release}-x86_64.deb"
# Refactor opportunity:
case "$ubuntu_release" in
20.04)
dependencies="libc6, libstdc++6, libqt5core5a, libqt5concurrent5, libqt5dbus5, libqt5gui5, libqt5network5, libqt5svg5, libqt5widgets5, qt5-image-formats-plugins, libboost-filesystem1.71.0"
# Qt6 static-linked deb, see https://github.com/Chatterino/docker
dependencies="libc6, libstdc++6, libblkid1, libbsd0, libc6, libexpat1, libffi7, libfontconfig1, libfreetype6, libglib2.0-0, libglvnd0, libglx0, libgraphite2-3, libharfbuzz0b, libicu66, libjpeg-turbo8, libmount1, libopengl0, libpcre2-16-0, libpcre3, libpng16-16, libselinux1, libssl1.1, libstdc++6, libuuid1, libx11-xcb1, libxau6, libxcb1, libxcb-cursor0, libxcb-glx0, libxcb-icccm4, libxcb-image0, libxcb-keysyms1, libxcb-randr0, libxcb-render0, libxcb-render-util0, libxcb-shape0, libxcb-shm0, libxcb-sync1, libxcb-util1, libxcb-xfixes0, libxcb-xkb1, libxdmcp6, libxkbcommon0, libxkbcommon-x11-0, zlib1g"
;;
22.04)
if [ -n "$Qt6_DIR" ]; then
echo "Qt6_DIR set, assuming Qt6"
dependencies="libc6, libstdc++6, libqt6core6, libqt6widgets6, libqt6network6, libqt6core5compat6, libqt6svg6, qt6-qpa-plugins, qt6-image-formats-plugins"
else
dependencies="libc6, libstdc++6, libqt5core5a, libqt5concurrent5, libqt5dbus5, libqt5gui5, libqt5network5, libqt5svg5, libqt5widgets5, qt5-image-formats-plugins, libboost-filesystem1.74.0"
fi
# Qt6 static-linked deb, see https://github.com/Chatterino/docker
dependencies="libc6, libstdc++6, libglx0, libopengl0, libpng16-16, libharfbuzz0b, libfreetype6, libfontconfig1, libjpeg-turbo8, libxcb-glx0, libegl1, libx11-6, libxkbcommon0, libx11-xcb1, libxkbcommon-x11-0, libxcb-cursor0, libxcb-icccm4, libxcb-image0, libxcb-keysyms1, libxcb-randr0, libxcb-render-util0, libxcb-shm0, libxcb-sync1, libxcb-xfixes0, libxcb-render0, libxcb-shape0, libxcb-xkb1, libxcb1, libbrotli1, libglib2.0-0, zlib1g, libicu70, libpcre2-16-0, libssl3, libgraphite2-3, libexpat1, libuuid1, libxcb-util1, libxau6, libxdmcp6, libbrotli1, libffi8, libmount1, libselinux1, libpcre3, libicu70, libbsd0, libblkid1, libpcre2-8-0, libmd0"
;;
*)
echo "Unsupported Ubuntu release $ubuntu_release"
Expand Down
30 changes: 30 additions & 0 deletions .CI/full-ubuntu-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh

# TODO: Investigate if the -fno-sized-deallocation flag is still necessary
# TODO: Test appimage/deb creation

set -e

env

rm -rf build
mkdir build
cmake \
-B build \
-DCMAKE_INSTALL_PREFIX=appdir/usr/ \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_APP=On \
-DBUILD_TESTS=On \
-DBUILD_BENCHMARKS=On \
-DUSE_PRECOMPILED_HEADERS=OFF \
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
-DCHATTERINO_PLUGINS="$C2_PLUGINS" \
-DCMAKE_PREFIX_PATH="$Qt6_DIR/lib/cmake" \
-DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \
-DCHATTERINO_STATIC_QT_BUILD=On \
-DCMAKE_CXX_FLAGS="-fno-sized-deallocation" \
.
cmake --build build

# sh ./../.CI/CreateAppImage.sh
# sh ./../.CI/CreateUbuntuDeb.sh
236 changes: 102 additions & 134 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,93 @@ env:
CONAN_VERSION: 2.0.2

jobs:
build:
name: "Build ${{ matrix.os }}, Qt ${{ matrix.qt-version }} (LTO:${{ matrix.force-lto }}, crashpad:${{ matrix.skip-crashpad && 'off' || 'on' }})"
runs-on: ${{ matrix.os }}
build-ubuntu-docker:
name: "Build Ubuntu in Docker"
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
matrix:
include:
# Ubuntu 20.04, Qt 5.12 - about time to drop this one
- os: ubuntu-20.04
qt-version: 5.12.12
container: ghcr.io/chatterino/chatterino2-build-ubuntu-20.04:latest
qt-version: 6.6.1
force-lto: false
plugins: false
plugins: true
skip-artifact: false
skip-crashpad: false
build-appimage: false
build-deb: true
- os: ubuntu-22.04
container: ghcr.io/chatterino/chatterino2-build-ubuntu-22.04:latest
qt-version: 6.6.1
force-lto: false
plugins: true
skip-artifact: false
skip-crashpad: false
build-appimage: true
build-deb: true
env:
C2_ENABLE_LTO: ${{ matrix.force-lto }}
C2_PLUGINS: ${{ matrix.plugins }}
C2_ENABLE_CRASHPAD: ${{ matrix.skip-crashpad == false }}
C2_BUILD_WITH_QT6: ${{ startsWith(matrix.qt-version, '6.') }}

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # allows for tags access

- name: Build
run: |
mkdir build
cd build
CXXFLAGS=-fno-sized-deallocation cmake \
-DCMAKE_INSTALL_PREFIX=appdir/usr/ \
-DCMAKE_BUILD_TYPE=Release \
-DPAJLADA_SETTINGS_USE_BOOST_FILESYSTEM=On \
-DUSE_PRECOMPILED_HEADERS=OFF \
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
-DCHATTERINO_LTO="$C2_ENABLE_LTO" \
-DCHATTERINO_PLUGINS="$C2_PLUGINS" \
-DCMAKE_PREFIX_PATH="$Qt6_DIR/lib/cmake" \
-DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \
-DCHATTERINO_STATIC_QT_BUILD=On \
..
make -j"$(nproc)"
- name: Package - AppImage (Ubuntu)
if: matrix.build-appimage
run: |
cd build
sh ./../.CI/CreateAppImage.sh
- name: Upload artifact - AppImage (Ubuntu)
if: matrix.build-appimage
uses: actions/upload-artifact@v4
with:
name: Chatterino-x86_64-Qt-${{ matrix.qt-version }}.AppImage
path: build/Chatterino-x86_64.AppImage

- name: Package - .deb (Ubuntu)
if: matrix.build-deb
run: |
cd build
sh ./../.CI/CreateUbuntuDeb.sh
- name: Upload artifact - .deb (Ubuntu)
if: matrix.build-deb
uses: actions/upload-artifact@v4
with:
name: Chatterino-${{ matrix.os }}-Qt-${{ matrix.qt-version }}.deb
path: build/Chatterino-${{ matrix.os }}-x86_64.deb

build:
name: "Build ${{ matrix.os }}, Qt ${{ matrix.qt-version }} (LTO:${{ matrix.force-lto }}, crashpad:${{ matrix.skip-crashpad && 'off' || 'on' }})"
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Ubuntu 22.04, Qt 5.15
- os: ubuntu-22.04
qt-version: 5.15.2
Expand Down Expand Up @@ -74,38 +148,13 @@ jobs:
skip-crashpad: true

fail-fast: false
env:
C2_ENABLE_LTO: ${{ matrix.force-lto }}
C2_PLUGINS: ${{ matrix.plugins }}
C2_ENABLE_CRASHPAD: ${{ matrix.skip-crashpad == false }}
C2_BUILD_WITH_QT6: ${{ startsWith(matrix.qt-version, '6.') }}

steps:
- name: Force LTO
if: matrix.force-lto
run: |
echo "C2_ENABLE_LTO=ON" >> "$GITHUB_ENV"
shell: bash

- name: Enable plugin support
if: matrix.plugins
run: |
echo "C2_PLUGINS=ON" >> "$GITHUB_ENV"
shell: bash

- name: Set Crashpad
if: matrix.skip-crashpad == false
run: |
echo "C2_ENABLE_CRASHPAD=ON" >> "$GITHUB_ENV"
shell: bash

- name: Set environment variables for windows-latest
if: matrix.os == 'windows-latest'
run: |
echo "vs_version=2022" >> "$GITHUB_ENV"
shell: bash

- name: Set BUILD_WITH_QT6
if: startsWith(matrix.qt-version, '6.')
run: |
echo "C2_BUILD_WITH_QT6=ON" >> "$GITHUB_ENV"
shell: bash

- uses: actions/checkout@v4
with:
submodules: recursive
Expand Down Expand Up @@ -290,83 +339,6 @@ jobs:
run: conan cache clean --source --build --download "*"
shell: bash

# LINUX
- name: Install dependencies (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get -y install \
cmake \
virtualenv \
rapidjson-dev \
libfuse2 \
libssl-dev \
libboost-dev \
libxcb-randr0-dev \
libboost-system-dev \
libboost-filesystem-dev \
libpulse-dev \
libxkbcommon-x11-0 \
build-essential \
libgl1-mesa-dev \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxcb-xinerama0
- name: Apply Qt patches (Ubuntu)
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.qt-version, '5.')
run: |
patch "$Qt5_DIR/include/QtConcurrent/qtconcurrentthreadengine.h" .patches/qt5-on-newer-gcc.patch
shell: bash

- name: Build (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
mkdir build
cd build
CXXFLAGS=-fno-sized-deallocation cmake \
-DCMAKE_INSTALL_PREFIX=appdir/usr/ \
-DCMAKE_BUILD_TYPE=Release \
-DPAJLADA_SETTINGS_USE_BOOST_FILESYSTEM=On \
-DUSE_PRECOMPILED_HEADERS=OFF \
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
-DCHATTERINO_LTO="$C2_ENABLE_LTO" \
-DCHATTERINO_PLUGINS="$C2_PLUGINS" \
-DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \
..
make -j"$(nproc)"
shell: bash

- name: Package - AppImage (Ubuntu)
if: startsWith(matrix.os, 'ubuntu-20.04') && !matrix.skip-artifact
run: |
cd build
sh ./../.CI/CreateAppImage.sh
shell: bash

- name: Package - .deb (Ubuntu)
if: startsWith(matrix.os, 'ubuntu') && !matrix.skip-artifact
run: |
cd build
sh ./../.CI/CreateUbuntuDeb.sh
shell: bash

- name: Upload artifact - AppImage (Ubuntu)
if: startsWith(matrix.os, 'ubuntu-20.04') && !matrix.skip-artifact
uses: actions/upload-artifact@v4
with:
name: Chatterino-x86_64-${{ matrix.qt-version }}.AppImage
path: build/Chatterino-x86_64.AppImage

- name: Upload artifact - .deb (Ubuntu)
if: startsWith(matrix.os, 'ubuntu') && !matrix.skip-artifact
uses: actions/upload-artifact@v4
with:
name: Chatterino-${{ matrix.os }}-Qt-${{ matrix.qt-version }}.deb
path: build/Chatterino-${{ matrix.os }}-x86_64.deb

# MACOS
- name: Install dependencies (MacOS)
if: startsWith(matrix.os, 'macos')
Expand Down Expand Up @@ -410,8 +382,9 @@ jobs:
with:
name: chatterino-macos-Qt-${{ matrix.qt-version }}.dmg
path: build/chatterino-macos-Qt-${{ matrix.qt-version }}.dmg

create-release:
needs: build
needs: [build-ubuntu-docker, build]
runs-on: ubuntu-latest
if: (github.event_name == 'push' && github.ref == 'refs/heads/dankerino')

Expand All @@ -420,12 +393,7 @@ jobs:
with:
fetch-depth: 0 # allows for tags access

- uses: actions/download-artifact@v4
name: Ubuntu 22.04 Qt6.2.4 deb
with:
name: Chatterino-ubuntu-22.04-Qt-6.2.4.deb
path: release-artifacts/

# Windows
- uses: actions/download-artifact@v4
name: Windows Qt6.5.0
with:
Expand All @@ -444,50 +412,50 @@ jobs:
name: chatterino-windows-x86-64-Qt-5.15.2.zip
path: release-artifacts/

# Linux
- uses: actions/download-artifact@v4
name: Linux Qt5.12.12 AppImage
name: Linux AppImage
with:
name: Chatterino-x86_64-5.12.12.AppImage
name: Chatterino-x86_64-Qt-6.6.1.AppImage
path: release-artifacts/

- uses: actions/download-artifact@v4
name: Ubuntu 20.04 Qt5.12.12 deb
name: Ubuntu 20.04 deb
with:
name: Chatterino-ubuntu-20.04-Qt-5.12.12.deb
name: Chatterino-ubuntu-20.04-Qt-6.6.1.deb
path: release-artifacts/

- uses: actions/download-artifact@v4
name: Ubuntu 22.04 Qt5.15.2 deb
name: Ubuntu 22.04 deb
with:
name: Chatterino-ubuntu-22.04-Qt-5.15.2.deb
name: Chatterino-ubuntu-22.04-Qt-6.6.1.deb
path: release-artifacts/

- name: Copy flatpakref
run: |
cp .CI/chatterino-nightly.flatpakref release-artifacts/
shell: bash

# macOS
- uses: actions/download-artifact@v4
name: macOS x86_64 Qt5.15.2 dmg
with:
name: chatterino-macos-Qt-5.15.2.dmg
path: release-artifacts/

- name: Copy flatpakref
run: |
cp .CI/chatterino-nightly.flatpakref release-artifacts/
shell: bash

- name: Rename artifacts
run: |
ls -l
# Rename the macos build to indicate that it's for macOS 10.15 users
mv chatterino-macos-Qt-5.15.2.dmg Chatterino-macOS-10.15.dmg
mv Chatterino-ubuntu-22.04-x86_64.deb EXPERIMENTAL-Chatterino-ubuntu-22.04-Qt-6.2.4.deb
# Mark all Windows Qt5 builds as old
mv chatterino-windows-x86-64-Qt-5.15.2.zip chatterino-windows-old-x86-64-Qt-5.15.2.zip
working-directory: release-artifacts
shell: bash

- name: Create release
uses: ncipollo/release-action@v1.13.0
uses: ncipollo/release-action@v1.14.0
with:
replacesArtifacts: true
allowUpdates: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:

- name: clang-tidy review
timeout-minutes: 20
uses: ZedThree/[email protected].0
uses: ZedThree/[email protected].1
with:
build_dir: build-clang-tidy
config_file: ".clang-tidy"
Expand All @@ -145,4 +145,4 @@ jobs:
libbenchmark-dev
- name: clang-tidy-review upload
uses: ZedThree/clang-tidy-review/[email protected].0
uses: ZedThree/clang-tidy-review/[email protected].1
2 changes: 1 addition & 1 deletion .github/workflows/post-clang-tidy-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- uses: ZedThree/clang-tidy-review/[email protected].0
- uses: ZedThree/clang-tidy-review/[email protected].1
with:
lgtm_comment_body: ""
Loading

0 comments on commit c7c0403

Please sign in to comment.