Files
orianne/.github/workflows/build.yaml

108 lines
3.0 KiB
YAML

name: Build for Linux
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
BUILD_TYPE: Release
jobs:
linux:
runs-on: ubuntu-20.04
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: "6.5.2"
host: "linux"
target: "desktop"
arch: "gcc_64"
install-deps: "true"
- name: List files in Qt
run: find ${{env.Qt5_Dir}}
- uses: actions/checkout@v3
- name: Configure CMake
run: cmake -B '${{github.workspace}}'/build
- name: Build
run: cmake --build '${{github.workspace}}'/build
- name: Download linuxdeployqt
run: |
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt-continuous-x86_64.AppImage
- name: Download dependencies
run: |
sudo apt-get update
sudo apt-get install libxcb-cursor0
- name: Package artifacts with linuxdeployqt
run: |
mkdir -p appdir/usr/bin/
mv ./build/TestTaker appdir/usr/bin/
export VERSION=0.0.1-linux # linuxdeployqt uses this for naming the package
echo "Version is: ${VERSION}"
./linuxdeployqt-continuous-x86_64.AppImage --appimage-extract-and-run appdir/usr/share/applications/*.desktop \
-appimage -verbose=2 -extra-plugins=iconengines
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: TestTaker-linux-appimage
path: TestTaker*.AppImage
windows:
runs-on: windows-latest
steps:
- name: Setup Microsoft Visual C++
uses: ilammy/msvc-dev-cmd@v1
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: "6.5.2"
host: "windows"
target: "desktop"
arch: "win64_msvc2019_64"
install-deps: "true"
- name: Checkout repository
uses: actions/checkout@v3
- name: Build for Windows
shell: bash
run: |
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -B '${{github.workspace}}'/build
cmake --build '${{github.workspace}}'/build
- name: Package Executables with windeployqt
shell: bash
run: |
VERSION=0.0.1-win
APPNAME=TestTaker-${VERSION}-win-x86_64.zip
echo "APPNAME=${APPNAME}" >> $GITHUB_ENV
mkdir packageDir
pushd packageDir
mv '${{github.workspace}}'/build/TestTaker.exe .
windeployqt.exe -svg --release --no-compiler-runtime --no-opengl-sw --no-translations TestTaker.exe
# 7z a -r ../${APPNAME} *
- uses: actions/upload-artifact@v3
with:
name: TestTaker-windows
path: packageDir/*