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
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
|
|
|
- '*.md'
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
|
|
|
- '*.md'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-02-21 16:38:27 +01:00
|
|
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
2021-03-06 14:05:03 +01:00
|
|
|
qt-version: [5.15.2, 5.12.10]
|
2021-02-14 13:03:39 +01:00
|
|
|
build-system: [qmake, cmake]
|
2019-12-28 14:54:03 +01:00
|
|
|
fail-fast: false
|
|
|
|
|
|
|
|
steps:
|
2020-11-04 17:54:00 +01:00
|
|
|
- uses: actions/checkout@v2.3.4
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
|
2020-04-25 13:42:56 +02:00
|
|
|
- name: Cache Qt
|
|
|
|
id: cache-qt
|
2021-02-11 16:36:38 +01:00
|
|
|
uses: actions/cache@v2.1.4
|
2020-04-25 13:42:56 +02:00
|
|
|
with:
|
|
|
|
path: ../Qt
|
2021-01-10 13:23:34 +01:00
|
|
|
key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-20210109
|
2020-10-04 16:51:42 +02:00
|
|
|
|
2021-02-15 16:25:01 +01:00
|
|
|
- name: Cache conan
|
|
|
|
if: matrix.build-system == 'cmake'
|
|
|
|
uses: actions/cache@v2.1.4
|
|
|
|
with:
|
2021-02-17 18:31:49 +01:00
|
|
|
key: ${{ runner.os }}-conan-${{ matrix.qt-version }}-${{ hashFiles('**/conanfile.txt') }}
|
2021-02-15 16:25:01 +01:00
|
|
|
path: ~/.conan
|
|
|
|
|
2020-10-04 16:51:42 +02:00
|
|
|
# LINUX
|
|
|
|
- name: Install p7zip (Ubuntu)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
run: sudo apt-get update && sudo apt-get -y install p7zip-full
|
2020-04-25 13:42:56 +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:
|
2021-02-13 12:20:37 +01:00
|
|
|
aqtversion: '==1.1.1'
|
2021-01-10 13:23:34 +01:00
|
|
|
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
|
|
|
extra: --external 7z
|
|
|
|
version: ${{ matrix.qt-version }}
|
|
|
|
|
2019-12-28 14:54:03 +01:00
|
|
|
# WINDOWS
|
2020-01-23 09:21:01 +01:00
|
|
|
|
|
|
|
- name: Cache conan packages
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
2021-02-11 16:36:38 +01:00
|
|
|
uses: actions/cache@v2.1.4
|
2020-01-23 09:21:01 +01:00
|
|
|
with:
|
2021-02-14 13:41:36 +01:00
|
|
|
key: ${{ runner.os }}-conan-pkg-${{ hashFiles('**/conanfile.txt') }}
|
2020-01-23 09:21:01 +01:00
|
|
|
path: C:/.conan/
|
|
|
|
|
2019-12-28 14:54:03 +01:00
|
|
|
- name: Install dependencies (Windows)
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
2021-02-14 13:41:36 +01:00
|
|
|
run: choco install conan jom -y
|
2019-12-28 14:54:03 +01:00
|
|
|
shell: cmd
|
|
|
|
|
2021-02-16 12:52:44 +01: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: Build (Windows)
|
2021-02-14 13:03:39 +01:00
|
|
|
if: startsWith(matrix.os, 'windows') && matrix.build-system == 'qmake'
|
2019-12-28 14:54:03 +01:00
|
|
|
run: |
|
|
|
|
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2021-02-14 13:41:36 +01:00
|
|
|
conan install ..\conanfile-qmake.txt
|
2019-12-28 14:54:03 +01:00
|
|
|
qmake ..
|
2021-02-13 11:35:55 +01:00
|
|
|
jom
|
2019-12-28 14:54:03 +01:00
|
|
|
windeployqt release/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/
|
|
|
|
cp release/chatterino.exe Chatterino2/
|
|
|
|
echo nightly > Chatterino2/modes
|
|
|
|
7z a chatterino-windows-x86-64.zip Chatterino2/
|
|
|
|
shell: cmd
|
|
|
|
|
2021-02-14 13:03:39 +01:00
|
|
|
- name: Build with CMake (Windows)
|
|
|
|
if: startsWith(matrix.os, 'windows') && matrix.build-system == 'cmake'
|
|
|
|
run: |
|
|
|
|
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2021-02-14 13:41:36 +01:00
|
|
|
cmake -G"NMake Makefiles JOM" -DCMAKE_BUILD_TYPE=Release -DUSE_PACKAGE_MANAGER=ON ..
|
|
|
|
jom
|
|
|
|
jom copy_dll
|
|
|
|
echo nightly > bin/modes
|
|
|
|
7z a chatterino-windows-x86-64.zip bin/
|
2021-02-14 13:03:39 +01:00
|
|
|
shell: cmd
|
|
|
|
|
2019-12-28 14:54:03 +01:00
|
|
|
- name: Upload artifact (Windows)
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
2021-01-05 12:24:27 +01:00
|
|
|
uses: actions/upload-artifact@v2.2.2
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
2021-02-14 13:03:39 +01:00
|
|
|
name: chatterino-windows-x86-64-${{ matrix.qt-version }}-${{ matrix.build-system }}.zip
|
2019-12-28 14:54:03 +01:00
|
|
|
path: build/chatterino-windows-x86-64.zip
|
|
|
|
|
|
|
|
# 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-02-14 13:03:39 +01:00
|
|
|
cmake \
|
2021-02-14 13:41:36 +01:00
|
|
|
virtualenv \
|
|
|
|
rapidjson-dev \
|
2020-12-05 14:31:28 +01:00
|
|
|
libssl-dev \
|
|
|
|
libboost-dev \
|
2021-02-15 16:02:27 +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)
|
2021-02-14 13:03:39 +01:00
|
|
|
if: startsWith(matrix.os, 'ubuntu') && matrix.build-system == 'qmake'
|
2019-12-28 14:54:03 +01:00
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
qmake PREFIX=/usr ..
|
|
|
|
make -j8
|
|
|
|
shell: bash
|
|
|
|
|
2021-02-14 13:03:39 +01:00
|
|
|
- name: Build with CMake (Ubuntu)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu') && matrix.build-system == 'cmake'
|
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2021-02-21 16:49:21 +01:00
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=appdir/usr/ -DCMAKE_BUILD_TYPE=Release -DUSE_BOOST_FILESYSTEM=On ..
|
2021-02-14 13:03:39 +01:00
|
|
|
make -j8
|
|
|
|
shell: bash
|
|
|
|
|
2019-12-28 14:54:03 +01:00
|
|
|
- name: Package (Ubuntu)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
|
|
|
cd build
|
|
|
|
sh ./../.CI/CreateAppImage.sh
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Upload artifact (Ubuntu)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
2021-01-05 12:24:27 +01:00
|
|
|
uses: actions/upload-artifact@v2.2.2
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
2021-02-14 13:03:39 +01:00
|
|
|
name: Chatterino-x86_64-${{ matrix.qt-version }}-${{ matrix.build-system }}.AppImage
|
2019-12-28 14:54:03 +01:00
|
|
|
path: build/Chatterino-x86_64.AppImage
|
|
|
|
|
|
|
|
# MACOS
|
|
|
|
- name: Install dependencies (MacOS)
|
|
|
|
if: startsWith(matrix.os, 'macos')
|
|
|
|
run: |
|
2021-02-14 13:03:39 +01:00
|
|
|
brew install boost openssl rapidjson p7zip create-dmg cmake
|
2019-12-28 14:54:03 +01:00
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Build (MacOS)
|
2021-02-14 13:03:39 +01:00
|
|
|
if: startsWith(matrix.os, 'macos') && matrix.build-system == 'qmake'
|
2019-12-28 14:54:03 +01:00
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2021-03-06 14:05:03 +01:00
|
|
|
$Qt5_DIR/bin/qmake .. DEFINES+=$dateOfBuild
|
2019-12-28 14:54:03 +01:00
|
|
|
make -j8
|
|
|
|
shell: bash
|
|
|
|
|
2021-02-14 13:03:39 +01:00
|
|
|
- name: Build with CMake (MacOS)
|
|
|
|
if: startsWith(matrix.os, 'macos') && matrix.build-system == 'cmake'
|
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2021-02-21 16:33:25 +01:00
|
|
|
cmake -DCMAKE_BUILD_TYPE=Release ..
|
2021-02-14 13:03:39 +01:00
|
|
|
make -j8
|
|
|
|
shell: bash
|
|
|
|
|
2019-12-28 14:54:03 +01:00
|
|
|
- name: Package (MacOS)
|
2021-02-19 10:45:18 +01:00
|
|
|
if: startsWith(matrix.os, 'macos') && matrix.build-system == 'qmake'
|
2019-12-28 14:54:03 +01:00
|
|
|
run: |
|
|
|
|
ls -la
|
|
|
|
pwd
|
|
|
|
ls -la build || true
|
|
|
|
cd build
|
|
|
|
sh ./../.CI/CreateDMG.sh
|
|
|
|
shell: bash
|
|
|
|
|
2021-02-19 10:45:18 +01:00
|
|
|
- name: Package (MacOS)
|
|
|
|
if: startsWith(matrix.os, 'macos') && matrix.build-system == 'cmake'
|
|
|
|
run: |
|
2021-02-21 16:37:37 +01:00
|
|
|
ls -la
|
|
|
|
pwd
|
|
|
|
ls -la build || true
|
|
|
|
cd build
|
|
|
|
sh ./../.CI/CreateDMG.sh
|
2021-02-19 10:45:18 +01:00
|
|
|
shell: bash
|
|
|
|
|
2019-12-28 14:54:03 +01:00
|
|
|
- name: Upload artifact (MacOS)
|
|
|
|
if: startsWith(matrix.os, 'macos')
|
2021-01-05 12:24:27 +01:00
|
|
|
uses: actions/upload-artifact@v2.2.2
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
2021-02-14 13:03:39 +01:00
|
|
|
name: chatterino-osx-${{ matrix.qt-version }}-${{ matrix.build-system }}.dmg
|
2019-12-28 14:54:03 +01:00
|
|
|
path: build/chatterino-osx.dmg
|
|
|
|
|
2021-02-16 12:52:44 +01:00
|
|
|
- name: Clean conan packages
|
|
|
|
if: matrix.build-system == 'cmake'
|
|
|
|
run: cmake -P cmake/pmm.cmake /Conan /Clean
|
|
|
|
|
2019-12-28 14:54:03 +01:00
|
|
|
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
|
|
|
|
|
2021-01-05 12:01:47 +01:00
|
|
|
- uses: actions/download-artifact@v2.0.8
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
2021-02-14 13:03:39 +01:00
|
|
|
name: chatterino-windows-x86-64-5.15.2-qmake.zip
|
2019-12-28 14:54:03 +01:00
|
|
|
path: windows/
|
|
|
|
|
2021-01-05 12:01:47 +01:00
|
|
|
- uses: actions/download-artifact@v2.0.8
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
2021-02-14 13:03:39 +01:00
|
|
|
name: Chatterino-x86_64-5.15.2-qmake.AppImage
|
2019-12-28 14:54:03 +01:00
|
|
|
path: linux/
|
|
|
|
|
2021-01-05 12:01:47 +01:00
|
|
|
- uses: actions/download-artifact@v2.0.8
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
2021-02-14 13:03:39 +01:00
|
|
|
name: chatterino-osx-5.15.2-qmake.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
|
|
|
|
|
|
|
|
- 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
|