2019-12-28 14:54:03 +01:00
|
|
|
---
|
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-12-13 13:14:18 +01:00
|
|
|
branches:
|
|
|
|
- master
|
2019-12-28 14:54:03 +01:00
|
|
|
pull_request:
|
2022-06-14 14:48:21 +02:00
|
|
|
workflow_dispatch:
|
2019-12-28 14:54:03 +01:00
|
|
|
|
2022-05-21 11:33:21 +02:00
|
|
|
concurrency:
|
|
|
|
group: build-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2019-12-28 14:54:03 +01:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-03-04 11:26:45 +01:00
|
|
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
2022-06-14 14:48:21 +02:00
|
|
|
qt-version: [5.15.2, 5.12.12]
|
2021-10-30 14:24:43 +02:00
|
|
|
pch: [true]
|
2021-03-28 16:58:51 +02:00
|
|
|
include:
|
2021-10-30 14:24:43 +02:00
|
|
|
- os: ubuntu-latest
|
|
|
|
qt-version: 5.15.2
|
|
|
|
pch: false
|
2019-12-28 14:54:03 +01:00
|
|
|
fail-fast: false
|
|
|
|
|
|
|
|
steps:
|
2022-03-04 11:26:45 +01:00
|
|
|
- name: Set environment variables for windows-latest
|
|
|
|
if: matrix.os == 'windows-latest'
|
2021-03-28 16:58:51 +02:00
|
|
|
run: |
|
2022-03-04 11:26:45 +01:00
|
|
|
echo "vs_version=2022" >> $GITHUB_ENV
|
2021-03-28 16:58:51 +02:00
|
|
|
shell: bash
|
|
|
|
|
2022-03-04 14:49:51 +01:00
|
|
|
- uses: actions/checkout@v3
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
|
|
|
submodules: true
|
2021-07-17 13:28:45 +02:00
|
|
|
fetch-depth: 0 # allows for tags access
|
2019-12-28 14:54:03 +01:00
|
|
|
|
2020-04-25 13:42:56 +02:00
|
|
|
- name: Cache Qt
|
|
|
|
id: cache-qt
|
2022-03-22 12:50:52 +01:00
|
|
|
uses: actions/cache@v3
|
2020-04-25 13:42:56 +02:00
|
|
|
with:
|
2022-03-04 11:51:17 +01:00
|
|
|
path: "${{ github.workspace }}/qt/"
|
|
|
|
key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}
|
2020-10-04 16:51:42 +02:00
|
|
|
|
2021-03-06 14:05:03 +01:00
|
|
|
- name: Install Qt
|
2020-04-25 13:42:56 +02:00
|
|
|
uses: jurplel/install-qt-action@v2
|
2021-01-10 13:23:34 +01:00
|
|
|
with:
|
|
|
|
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
|
|
|
version: ${{ matrix.qt-version }}
|
2022-03-04 11:51:17 +01:00
|
|
|
dir: "${{ github.workspace }}/qt/"
|
2021-01-10 13:23:34 +01:00
|
|
|
|
2019-12-28 14:54:03 +01:00
|
|
|
# WINDOWS
|
2022-03-04 11:26:45 +01:00
|
|
|
- name: Cache conan packages part 1
|
2020-01-23 09:21:01 +01:00
|
|
|
if: startsWith(matrix.os, 'windows')
|
2022-03-22 12:50:52 +01:00
|
|
|
uses: actions/cache@v3
|
2020-01-23 09:21:01 +01:00
|
|
|
with:
|
2022-03-04 11:26:45 +01:00
|
|
|
key: ${{ runner.os }}-conan-user-${{ hashFiles('**/conanfile.txt') }}
|
|
|
|
path: ~/.conan/
|
|
|
|
|
|
|
|
- name: Cache conan packages part 2
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
2022-03-22 12:50:52 +01:00
|
|
|
uses: actions/cache@v3
|
2022-03-04 11:26:45 +01:00
|
|
|
with:
|
|
|
|
key: ${{ runner.os }}-conan-root-${{ hashFiles('**/conanfile.txt') }}
|
2020-01-23 09:21:01 +01:00
|
|
|
path: C:/.conan/
|
|
|
|
|
2021-04-11 14:46:25 +02:00
|
|
|
- name: Add Conan to path
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
|
|
|
run: echo "C:\Program Files\Conan\conan\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
|
|
|
2019-12-28 14:54:03 +01:00
|
|
|
- name: Install dependencies (Windows)
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
|
|
|
run: |
|
2020-05-24 11:53:24 +02:00
|
|
|
choco install conan -y
|
2021-04-11 14:46:25 +02:00
|
|
|
|
|
|
|
- name: Enable Developer Command Prompt
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
2022-10-16 17:55:14 +02:00
|
|
|
uses: ilammy/msvc-dev-cmd@v1.12.0
|
2019-12-28 14:54:03 +01:00
|
|
|
|
|
|
|
- name: Build (Windows)
|
2022-07-23 14:04:29 +02:00
|
|
|
if: startsWith(matrix.os, 'windows')
|
2021-03-28 16:58:51 +02:00
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2022-03-04 11:26:45 +01:00
|
|
|
conan install .. -b missing
|
2021-03-28 16:58:51 +02:00
|
|
|
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DUSE_CONAN=ON ..
|
|
|
|
set cl=/MP
|
|
|
|
nmake /S /NOLOGO
|
|
|
|
windeployqt bin/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/
|
|
|
|
cp bin/chatterino.exe Chatterino2/
|
|
|
|
echo nightly > Chatterino2/modes
|
|
|
|
7z a chatterino-windows-x86-64.zip Chatterino2/
|
2021-03-14 17:25:32 +01:00
|
|
|
|
2019-12-28 14:54:03 +01:00
|
|
|
- name: Upload artifact (Windows)
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
2022-03-04 11:06:15 +01:00
|
|
|
uses: actions/upload-artifact@v3
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
2022-07-23 14:04:29 +02:00
|
|
|
name: chatterino-windows-x86-64-${{ matrix.qt-version }}.zip
|
2019-12-28 14:54:03 +01:00
|
|
|
path: build/chatterino-windows-x86-64.zip
|
|
|
|
|
2022-03-04 11:26:45 +01:00
|
|
|
- name: Clean Conan pkgs
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
|
|
|
run: conan remove "*" -fsb
|
|
|
|
shell: bash
|
|
|
|
|
2019-12-28 14:54:03 +01:00
|
|
|
# LINUX
|
|
|
|
- name: Install dependencies (Ubuntu)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
2020-12-05 14:31:28 +01:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get -y install \
|
2021-03-28 16:58:51 +02:00
|
|
|
cmake \
|
|
|
|
virtualenv \
|
|
|
|
rapidjson-dev \
|
2020-12-05 14:31:28 +01:00
|
|
|
libssl-dev \
|
|
|
|
libboost-dev \
|
2021-03-10 22:00:29 +01:00
|
|
|
libxcb-randr0-dev \
|
2020-12-05 14:31:28 +01:00
|
|
|
libboost-system-dev \
|
|
|
|
libboost-filesystem-dev \
|
|
|
|
libpulse-dev \
|
|
|
|
libxkbcommon-x11-0 \
|
|
|
|
libgstreamer-plugins-base1.0-0 \
|
|
|
|
build-essential \
|
|
|
|
libgl1-mesa-dev \
|
|
|
|
libxcb-icccm4 \
|
|
|
|
libxcb-image0 \
|
|
|
|
libxcb-keysyms1 \
|
|
|
|
libxcb-render-util0 \
|
|
|
|
libxcb-xinerama0
|
2019-12-28 14:54:03 +01:00
|
|
|
|
|
|
|
- name: Build (Ubuntu)
|
2022-07-23 14:04:29 +02:00
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
2021-03-28 16:58:51 +02:00
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2021-10-30 14:24:43 +02:00
|
|
|
cmake \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=appdir/usr/ \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DPAJLADA_SETTINGS_USE_BOOST_FILESYSTEM=On \
|
|
|
|
-DUSE_PRECOMPILED_HEADERS=${{ matrix.pch }} \
|
2022-07-31 16:16:22 +02:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
|
2021-10-30 14:24:43 +02:00
|
|
|
..
|
2022-03-12 12:25:35 +01:00
|
|
|
make -j$(nproc)
|
2021-03-28 16:58:51 +02:00
|
|
|
shell: bash
|
|
|
|
|
2022-07-31 16:16:22 +02:00
|
|
|
- name: clang-tidy review
|
2022-07-31 17:32:43 +02:00
|
|
|
if: (startsWith(matrix.os, 'ubuntu') && matrix.pch == false && matrix.qt-version == '5.15.2' && github.event_name == 'pull_request')
|
2022-10-29 11:47:27 +02:00
|
|
|
uses: ZedThree/clang-tidy-review@v0.10.1
|
2022-07-31 16:16:22 +02:00
|
|
|
id: review
|
|
|
|
with:
|
|
|
|
build_dir: build
|
|
|
|
config_file: '.clang-tidy'
|
2022-08-28 13:32:07 +02:00
|
|
|
split_workflow: true
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
if: (startsWith(matrix.os, 'ubuntu') && matrix.pch == false && matrix.qt-version == '5.15.2' && github.event_name == 'pull_request')
|
|
|
|
with:
|
|
|
|
name: clang-tidy-review
|
|
|
|
path: |
|
|
|
|
clang-tidy-review-output.json
|
|
|
|
clang-tidy-review-metadata.json
|
2022-07-31 16:16:22 +02:00
|
|
|
|
2021-07-17 13:28:45 +02:00
|
|
|
- name: Package - AppImage (Ubuntu)
|
2019-12-28 14:54:03 +01:00
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
|
|
|
cd build
|
|
|
|
sh ./../.CI/CreateAppImage.sh
|
|
|
|
shell: bash
|
|
|
|
|
2021-07-17 13:28:45 +02:00
|
|
|
- name: Package - .deb (Ubuntu)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
|
|
|
cd build
|
|
|
|
sh ./../.CI/CreateUbuntuDeb.sh
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Upload artifact - AppImage (Ubuntu)
|
2019-12-28 14:54:03 +01:00
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
2022-03-04 11:06:15 +01:00
|
|
|
uses: actions/upload-artifact@v3
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
2022-07-23 14:04:29 +02:00
|
|
|
name: Chatterino-x86_64-${{ matrix.qt-version }}.AppImage
|
2019-12-28 14:54:03 +01:00
|
|
|
path: build/Chatterino-x86_64.AppImage
|
|
|
|
|
2021-07-17 13:28:45 +02:00
|
|
|
- name: Upload artifact - .deb (Ubuntu)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
2022-03-04 11:06:15 +01:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-07-17 13:28:45 +02:00
|
|
|
with:
|
2022-07-23 14:04:29 +02:00
|
|
|
name: Chatterino-${{ matrix.qt-version }}.deb
|
2021-07-17 13:28:45 +02:00
|
|
|
path: build/Chatterino.deb
|
|
|
|
|
2019-12-28 14:54:03 +01:00
|
|
|
# MACOS
|
|
|
|
- name: Install dependencies (MacOS)
|
|
|
|
if: startsWith(matrix.os, 'macos')
|
|
|
|
run: |
|
2021-03-28 16:58:51 +02:00
|
|
|
brew install boost openssl rapidjson p7zip create-dmg cmake tree
|
2019-12-28 14:54:03 +01:00
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Build (MacOS)
|
2022-07-23 14:04:29 +02:00
|
|
|
if: startsWith(matrix.os, 'macos')
|
2021-03-28 16:58:51 +02:00
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
2022-08-15 22:41:40 +02:00
|
|
|
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
|
2021-03-28 16:58:51 +02:00
|
|
|
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl \
|
2021-10-30 14:24:43 +02:00
|
|
|
-DUSE_PRECOMPILED_HEADERS=${{ matrix.pch }} \
|
2021-03-28 16:58:51 +02:00
|
|
|
..
|
2022-03-12 12:25:35 +01:00
|
|
|
make -j$(sysctl -n hw.logicalcpu)
|
2021-03-28 16:58:51 +02:00
|
|
|
shell: bash
|
|
|
|
|
2019-12-28 14:54:03 +01:00
|
|
|
- name: Package (MacOS)
|
|
|
|
if: startsWith(matrix.os, 'macos')
|
|
|
|
run: |
|
|
|
|
ls -la
|
|
|
|
pwd
|
|
|
|
ls -la build || true
|
|
|
|
cd build
|
|
|
|
sh ./../.CI/CreateDMG.sh
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Upload artifact (MacOS)
|
|
|
|
if: startsWith(matrix.os, 'macos')
|
2022-03-04 11:06:15 +01:00
|
|
|
uses: actions/upload-artifact@v3
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
2022-07-23 14:04:29 +02:00
|
|
|
name: chatterino-osx-${{ matrix.qt-version }}.dmg
|
2019-12-28 14:54:03 +01:00
|
|
|
path: build/chatterino-osx.dmg
|
|
|
|
|
|
|
|
create-release:
|
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: (github.event_name == 'push' && github.ref == 'refs/heads/master')
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Create release
|
|
|
|
id: create_release
|
2020-11-02 23:33:58 +01:00
|
|
|
uses: pajlada/create-release@v2.0.3
|
2019-12-28 14:54:03 +01:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
2021-01-05 13:52:38 +01:00
|
|
|
tag_name: nightly-build
|
|
|
|
backup_tag_name: backup-nightly-build
|
2020-11-15 15:29:18 +01:00
|
|
|
release_name: Nightly Release
|
2019-12-28 14:54:03 +01:00
|
|
|
body: |
|
2021-01-05 13:52:38 +01:00
|
|
|
Nightly Build
|
2019-12-28 14:54:03 +01:00
|
|
|
prerelease: true
|
|
|
|
|
2022-03-04 15:18:06 +01:00
|
|
|
- uses: actions/download-artifact@v3
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
2022-07-23 14:04:29 +02:00
|
|
|
name: chatterino-windows-x86-64-5.15.2.zip
|
2019-12-28 14:54:03 +01:00
|
|
|
path: windows/
|
|
|
|
|
2022-03-04 15:18:06 +01:00
|
|
|
- uses: actions/download-artifact@v3
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
2022-07-23 14:04:29 +02:00
|
|
|
name: Chatterino-x86_64-5.15.2.AppImage
|
2019-12-28 14:54:03 +01:00
|
|
|
path: linux/
|
|
|
|
|
2022-03-04 15:18:06 +01:00
|
|
|
- uses: actions/download-artifact@v3
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
2022-07-23 14:04:29 +02:00
|
|
|
name: Chatterino-5.15.2.deb
|
2021-07-17 13:28:45 +02:00
|
|
|
path: ubuntu/
|
|
|
|
|
2022-03-04 15:18:06 +01:00
|
|
|
- uses: actions/download-artifact@v3
|
2021-07-17 13:28:45 +02:00
|
|
|
with:
|
2022-07-23 14:04:29 +02:00
|
|
|
name: chatterino-osx-5.15.2.dmg
|
2019-12-28 14:54:03 +01:00
|
|
|
path: macos/
|
|
|
|
|
|
|
|
# TODO: Extract dmg and appimage
|
|
|
|
|
|
|
|
# - name: Read upload URL into output
|
|
|
|
# id: upload_url
|
|
|
|
# run: |
|
|
|
|
# echo "::set-output name=upload_url::$(cat release-upload-url.txt/release-upload-url.txt)"
|
|
|
|
|
|
|
|
- name: Upload release asset (Windows)
|
2020-10-10 10:40:03 +02:00
|
|
|
uses: actions/upload-release-asset@v1.0.2
|
2019-12-28 14:54:03 +01:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2021-01-10 13:39:56 +01:00
|
|
|
asset_path: ./windows/chatterino-windows-x86-64.zip
|
2019-12-28 14:54:03 +01:00
|
|
|
asset_name: chatterino-windows-x86-64.zip
|
|
|
|
asset_content_type: application/zip
|
|
|
|
|
|
|
|
- name: Upload release asset (Ubuntu)
|
2020-10-10 10:40:03 +02:00
|
|
|
uses: actions/upload-release-asset@v1.0.2
|
2019-12-28 14:54:03 +01:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2021-01-10 13:39:56 +01:00
|
|
|
asset_path: ./linux/Chatterino-x86_64.AppImage
|
2019-12-28 14:54:03 +01:00
|
|
|
asset_name: Chatterino-x86_64.AppImage
|
|
|
|
asset_content_type: application/x-executable
|
|
|
|
|
2021-07-17 13:28:45 +02:00
|
|
|
- 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
|
|
|
|
|
2019-12-28 14:54:03 +01:00
|
|
|
- name: Upload release asset (MacOS)
|
2020-10-10 10:40:03 +02:00
|
|
|
uses: actions/upload-release-asset@v1.0.2
|
2019-12-28 14:54:03 +01:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2021-01-10 13:39:56 +01:00
|
|
|
asset_path: ./macos/chatterino-osx.dmg
|
2019-12-28 14:54:03 +01:00
|
|
|
asset_name: chatterino-osx.dmg
|
|
|
|
asset_content_type: application/x-bzip2
|
2021-03-28 16:58:51 +02:00
|
|
|
|