mirror-chatterino2/.github/workflows/build.yml

315 lines
10 KiB
YAML
Raw Normal View History

2019-12-28 14:54:03 +01:00
---
name: Build
on:
push:
branches:
- master
2019-12-28 14:54:03 +01:00
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
2022-01-15 00:55:29 +01:00
os: [windows-latest, macos-latest]
qt-version: [5.15.2, 5.12.10]
build-system: [qmake, cmake]
pch: [true]
exclude:
- os: windows-latest
qt-version: 5.12.10
build-system: cmake
pch: true
include:
- os: windows-2016
qt-version: 5.12.10
build-system: cmake
pch: true
- os: ubuntu-latest
qt-version: 5.15.2
build-system: cmake
pch: false
2019-12-28 14:54:03 +01:00
fail-fast: false
steps:
- name: Set environment variables for windows-latest
if: matrix.os == 'windows-latest'
run: |
echo "vs_version=2019" >> $GITHUB_ENV
shell: bash
- name: Set environment variables for windows-2016
if: matrix.os == 'windows-2016'
run: |
echo "vs_version=2017" >> $GITHUB_ENV
shell: bash
- uses: actions/checkout@v2.4.0
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
- name: Cache Qt
id: cache-qt
uses: actions/cache@v2.1.7
with:
path: ../Qt
key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-20210109
2020-10-04 16:51:42 +02:00
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
aqtversion: '==1.1.1'
cached: ${{ steps.cache-qt.outputs.cache-hit }}
extra: --external 7z
version: ${{ matrix.qt-version }}
2019-12-28 14:54:03 +01:00
# WINDOWS
- name: Cache conan packages
if: startsWith(matrix.os, 'windows')
uses: actions/cache@v2.1.7
with:
2021-04-12 23:16:15 +02:00
key: ${{ runner.os }}-conan-${{ hashFiles('**/conanfile.txt') }}-20210412
path: C:/.conan/
- 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: |
choco install conan -y
- name: Enable Developer Command Prompt
if: startsWith(matrix.os, 'windows')
uses: ilammy/msvc-dev-cmd@v1.10.0
2019-12-28 14:54:03 +01:00
- name: Build (Windows)
if: startsWith(matrix.os, 'windows') && matrix.build-system == 'qmake'
2019-12-28 14:54:03 +01:00
run: |
mkdir build
cd build
conan install ..
2019-12-28 14:54:03 +01:00
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/
- name: Build with CMake (Windows)
if: startsWith(matrix.os, 'windows') && matrix.build-system == 'cmake'
run: |
mkdir build
cd build
conan install ..
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/
2019-12-28 14:54:03 +01:00
- name: Upload artifact (Windows)
if: startsWith(matrix.os, 'windows')
uses: actions/upload-artifact@v2.3.1
2019-12-28 14:54:03 +01:00
with:
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
# MACOS
- name: Install dependencies (MacOS)
if: startsWith(matrix.os, 'macos')
run: |
brew install boost openssl rapidjson p7zip create-dmg cmake tree
2019-12-28 14:54:03 +01:00
shell: bash
- name: Build (MacOS)
if: startsWith(matrix.os, 'macos') && matrix.build-system == 'qmake'
2019-12-28 14:54:03 +01:00
run: |
mkdir build
cd build
$Qt5_DIR/bin/qmake .. DEFINES+=$dateOfBuild
2019-12-28 14:54:03 +01:00
make -j8
shell: bash
- name: Build with CMake (MacOS)
if: startsWith(matrix.os, 'macos') && matrix.build-system == 'cmake'
run: |
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl \
-DUSE_PRECOMPILED_HEADERS=${{ matrix.pch }} \
..
make -j8
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')
uses: actions/upload-artifact@v2.3.1
2019-12-28 14:54:03 +01:00
with:
name: chatterino-osx-${{ matrix.qt-version }}-${{ matrix.build-system }}.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
uses: pajlada/create-release@v2.0.3
2019-12-28 14:54:03 +01:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly-build
backup_tag_name: backup-nightly-build
release_name: Nightly Release
2019-12-28 14:54:03 +01:00
body: |
Nightly Build
2019-12-28 14:54:03 +01:00
prerelease: true
- uses: actions/download-artifact@v2.1.0
2019-12-28 14:54:03 +01:00
with:
name: chatterino-windows-x86-64-5.15.2-qmake.zip
2019-12-28 14:54:03 +01:00
path: windows/
- uses: actions/download-artifact@v2.1.0
2019-12-28 14:54:03 +01:00
with:
name: chatterino-windows-x86-64-5.15.2-cmake.zip
path: windows-cmake/
- uses: actions/download-artifact@v2.1.0
with:
name: Chatterino-x86_64-5.15.2-qmake.AppImage
2019-12-28 14:54:03 +01:00
path: linux/
- uses: actions/download-artifact@v2.1.0
2019-12-28 14:54:03 +01:00
with:
name: Chatterino-x86_64-5.15.2-cmake.AppImage
path: linux-cmake/
- uses: actions/download-artifact@v2.1.0
2021-07-17 13:28:45 +02:00
with:
name: Chatterino-5.15.2-qmake.deb
path: ubuntu/
- uses: actions/download-artifact@v2.1.0
2021-07-17 13:28:45 +02:00
with:
name: Chatterino-5.15.2-cmake.deb
path: ubuntu-cmake/
- uses: actions/download-artifact@v2.1.0
with:
name: chatterino-osx-5.15.2-qmake.dmg
2019-12-28 14:54:03 +01:00
path: macos/
- uses: actions/download-artifact@v2.1.0
with:
name: chatterino-osx-5.15.2-cmake.dmg
path: macos-cmake/
2019-12-28 14:54:03 +01:00
# 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)
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
2019-12-28 14:54:03 +01:00
asset_name: chatterino-windows-x86-64.zip
asset_content_type: application/zip
- name: Upload release asset (Windows) 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: ./windows-cmake/chatterino-windows-x86-64.zip
asset_name: test-cmake-chatterino-windows-x86-64.zip
asset_content_type: application/zip
2019-12-28 14:54:03 +01:00
- name: Upload release asset (Ubuntu)
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
2019-12-28 14:54:03 +01:00
asset_name: Chatterino-x86_64.AppImage
asset_content_type: application/x-executable
- name: Upload release asset (Ubuntu) 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: ./linux-cmake/Chatterino-x86_64.AppImage
asset_name: test-cmake-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
- 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
2019-12-28 14:54:03 +01:00
- name: Upload release asset (MacOS)
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
2019-12-28 14:54:03 +01:00
asset_name: chatterino-osx.dmg
asset_content_type: application/x-bzip2
- name: Upload release asset (MacOS) 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: ./macos-cmake/chatterino-osx.dmg
asset_name: test-cmake-chatterino-osx.dmg
asset_content_type: application/x-bzip2