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:
|
|
|
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
|
|
|
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
|
2020-06-21 16:36:46 +02:00
|
|
|
uses: actions/cache@v2
|
2020-04-25 13:42:56 +02:00
|
|
|
with:
|
|
|
|
path: ../Qt
|
2020-10-05 20:11:49 +02:00
|
|
|
key: ${{ runner.os }}-QtCache-20201005
|
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
|
|
|
|
2019-12-28 14:54:03 +01:00
|
|
|
- name: Install Qt
|
2020-04-25 13:42:56 +02:00
|
|
|
uses: jurplel/install-qt-action@v2
|
|
|
|
with:
|
2020-10-05 20:11:49 +02:00
|
|
|
# mirror: 'http://mirrors.ocf.berkeley.edu/qt/'
|
2020-04-25 13:42:56 +02:00
|
|
|
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
2020-10-04 16:51:42 +02:00
|
|
|
extra: --external 7z
|
2019-12-28 14:54:03 +01:00
|
|
|
|
|
|
|
# WINDOWS
|
2020-01-23 09:21:01 +01:00
|
|
|
- name: Cache conan
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
key: ${{ runner.os }}-conan-root-${{ hashFiles('**/conanfile.txt') }}
|
|
|
|
path: ~/.conan
|
|
|
|
|
|
|
|
- name: Cache conan packages
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
key: ${{ runner.os }}-conan-pkg-${{ hashFiles('**/conanfile.txt') }}
|
|
|
|
path: C:/.conan/
|
|
|
|
|
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
|
2019-12-28 14:54:03 +01:00
|
|
|
|
|
|
|
refreshenv
|
|
|
|
shell: cmd
|
|
|
|
|
|
|
|
- name: Build (Windows)
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
|
|
|
run: |
|
|
|
|
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
"C:\Program Files\Conan\conan\conan.exe" install ..
|
|
|
|
qmake ..
|
|
|
|
set cl=/MP
|
|
|
|
nmake /S /NOLOGO
|
|
|
|
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
|
|
|
|
|
|
|
|
- name: Upload artifact (Windows)
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
2020-11-21 16:40:09 +01:00
|
|
|
uses: actions/upload-artifact@v2.2.1
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
|
|
|
name: chatterino-windows-x86-64.zip
|
|
|
|
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 \
|
|
|
|
libssl-dev \
|
|
|
|
libboost-dev \
|
|
|
|
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)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
qmake PREFIX=/usr ..
|
|
|
|
make -j8
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- 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')
|
2020-11-21 16:40:09 +01:00
|
|
|
uses: actions/upload-artifact@v2.2.1
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
|
|
|
name: Chatterino-x86_64.AppImage
|
|
|
|
path: build/Chatterino-x86_64.AppImage
|
|
|
|
|
|
|
|
# MACOS
|
|
|
|
- name: Install dependencies (MacOS)
|
|
|
|
if: startsWith(matrix.os, 'macos')
|
|
|
|
run: |
|
|
|
|
brew install boost openssl rapidjson qt p7zip create-dmg
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Build (MacOS)
|
|
|
|
if: startsWith(matrix.os, 'macos')
|
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
/usr/local/opt/qt/bin/qmake .. DEFINES+=$dateOfBuild
|
|
|
|
sed -ie 's/-framework\\\ /-framework /g' Makefile
|
|
|
|
make -j8
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- 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')
|
2020-11-21 16:40:09 +01:00
|
|
|
uses: actions/upload-artifact@v2.2.1
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
|
|
|
name: chatterino-osx.dmg
|
|
|
|
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:
|
|
|
|
tag_name: github-actions-nightly
|
|
|
|
backup_tag_name: backup-github-actions-nightly
|
2020-11-15 15:29:18 +01:00
|
|
|
release_name: Nightly Release
|
2019-12-28 14:54:03 +01:00
|
|
|
body: |
|
|
|
|
1 ${{ github.eventName }}
|
|
|
|
2 ${{ github.sha }}
|
|
|
|
3 ${{ github.ref }}
|
|
|
|
4 ${{ github.workflow }}
|
|
|
|
5 ${{ github.action }}
|
|
|
|
6 ${{ github.actor }}
|
|
|
|
prerelease: true
|
|
|
|
|
2020-11-21 16:40:25 +01:00
|
|
|
- uses: actions/download-artifact@v2.0.6
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
|
|
|
name: chatterino-windows-x86-64.zip
|
|
|
|
path: windows/
|
|
|
|
|
2020-11-21 16:40:25 +01:00
|
|
|
- uses: actions/download-artifact@v2.0.6
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
|
|
|
name: Chatterino-x86_64.AppImage
|
|
|
|
path: linux/
|
|
|
|
|
2020-11-21 16:40:25 +01:00
|
|
|
- uses: actions/download-artifact@v2.0.6
|
2019-12-28 14:54:03 +01:00
|
|
|
with:
|
|
|
|
name: chatterino-osx.dmg
|
|
|
|
path: macos/
|
|
|
|
|
|
|
|
# TODO: Extract dmg and appimage
|
|
|
|
|
|
|
|
- name: TREE
|
|
|
|
run: |
|
|
|
|
sudo apt update && sudo apt install tree
|
|
|
|
tree .
|
|
|
|
|
|
|
|
# - 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 }}
|
|
|
|
asset_path: ./windows/chatterino-windows-x86-64.zip
|
|
|
|
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 }}
|
|
|
|
asset_path: ./linux/Chatterino-x86_64.AppImage
|
|
|
|
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 }}
|
|
|
|
asset_path: ./macos/chatterino-osx.dmg
|
|
|
|
asset_name: chatterino-osx.dmg
|
|
|
|
asset_content_type: application/x-bzip2
|