Skip to content

IM TIRED

IM TIRED #117

Workflow file for this run

# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: CMake on multiple platforms
on:
workflow_call:
inputs:
build_type:
description: Type of build (Debug, Release, RelWithDebInfo, MinSizeRel)
type: string
default: Debug
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
arch: "amd64"
appimage_arch: "x86_64"
gcc_arch: "gcc_64"
qt_host: linux
qt_version: '6.8.1'
qt_modules: 'qtmultimedia qtwaylandcompositor'
qt_arch: 'linux_gcc_64'
- os: ubuntu-24.04-arm
arch: "aarch64"
appimage_arch: "aarch64"
gcc_arch: "gcc_arm64"
qt_host: linux_arm64
qt_version: '6.8.1'
qt_modules: 'qtmultimedia qtwaylandcompositor'
qt_arch: 'linux_gcc_arm64'
- os: windows-2022
arch: "amd64"
msvc_arch: 'msvc2022_64'
qt_host: windows
qt_version: '6.8.1'
qt_modules: 'qtmultimedia'
qt_arch: 'win64_msvc2022_64'
# TODO: wait for the arm images to become public
#- os: windows-2022
#arch: "aarch64"
#msvc_arch: 'msvc2022_arm64'
#qt_host: windows_arm64
#qt_version: '6.8.1'
#qt_modules: 'qtmultimedia'
#qt_arch: 'win64_msvc2022_arm64'
- os: macos-latest
arch: "universal"
qt_host: mac
qt_version: '6.8.1'
qt_modules: 'qtmultimedia'
qt_arch: 'clang_64'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'recursive'
- name: Grab and store version
shell: bash
run: |
tag_name=$(git describe --tags --abbrev=0)
echo "VERSION=$tag_name" >> $GITHUB_ENV
echo "BUILD_DIR=${{ github.workspace }}/build" >> $GITHUB_ENV
echo "INSTALL_DIR=${{ github.workspace }}/install" >> $GITHUB_ENV
echo "INSTALL_APPIMAGE_DIR=${{ github.workspace }}/install-appdir" >> $GITHUB_ENV
echo "NTCORE_INSTALL_DIR=${{ github.workspace }}/install-ntcore" >> $GITHUB_ENV
echo "DATE=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_ENV
- name: Install CMake
uses: lukka/[email protected]
- name: Setup CCache
if: matrix.arch != 'aarch64' || runner.os == 'macOS'
uses: hendrikmuhs/[email protected]
with:
key: ${{ runner.os }}-${{ inputs.build_type }}
- name: Cache Build Deps
uses: actions/cache@v4
with:
path: ${{ env.BUILD_DIR }}/_deps/*-src
key: QFRCDashboard
- uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
- uses: repolevedavaj/[email protected]
if: runner.os == 'Windows'
with:
nsis-version: 3.09
- name: Install Protobuf
uses: ConorMacBride/install-package@v1
with:

Check failure on line 106 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build.yml

Invalid workflow file

You have an error in your yaml syntax on line 106
brew: protobuf
choco: protoc
apt: protobuf-compiler
- name: Install Qt
uses: jdpurcell/install-qt-action@v4
with:
host: ${{ matrix.qt_host }}
version: ${{ matrix.qt_version }}
modules: ${{ matrix.qt_modules }}
arch: ${{ matrix.qt_arch }}
aqtversion: ==3.1.*
cache: true
- name: Set up Python 3.8 (macOS)
if: runner.os == 'macOS'
uses: actions/setup-python@v5
with:
python-version: 3.8
cache: 'pip'
- name: Install Python Dependencies
run: |
pip install jinja2
- name: Prepare AppImage (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get install libfuse2 libgstreamer-plugins-bad1.0-dev
wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${{ matrix.appimage_arch }}.AppImage"
wget "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-${{ matrix.appimage_arch }}.AppImage"
- name: Install Build Dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew update
brew install llvm ninja
- name: Configure CMake
if: matrix.arch != 'aarch64'
run: |
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBUILD_SHARED_LIBS=OFF
- name: Configure CMake (aarch64)
if: matrix.arch == 'aarch64' && runner.os != 'macOS'
run: |
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -G Ninja -DBUILD_SHARED_LIBS=OFF
- name: Configure CMake (macOS)
if: runner.os == 'macOS'
run: |
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBUILD_SHARED_LIBS=OFF -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
- name: Build
run: |
cmake --build ${{ env.BUILD_DIR }} --parallel $(nproc) --config ${{ inputs.build_type }}
- name: Package (Linux)
if: runner.os == 'Linux'
run: |
cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_DIR }}/usr
cd ${{ env.INSTALL_DIR }}
tar --owner root --group root -czf ../QFRCDashboard.tar.zst *
- name: Package AppImage & System (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get install libxcb-cursor-dev libxcb-cursor0
mkdir -p ${{ env.INSTALL_APPIMAGE_DIR}}/usr/{lib,bin}
cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_APPIMAGE_DIR }}/usr
export OUTPUT="QFRCDashboard-Linux-${{ env.VERSION }}-${{ inputs.build_type }}-${{ matrix.arch }}.AppImage"
export QML_SOURCES_PATHS="${{ runner.workspace }}/Qt/${{ matrix.qt_version }}/${{ matrix.gcc_arch }}/qml:${{ github.workspace }}"
chmod +x linuxdeploy-*.AppImage
mkdir -p ${{ env.INSTALL_APPIMAGE_DIR }}/usr/plugins/
cp -r ${{ runner.workspace }}/Qt/${{ matrix.qt_version }}/${{ matrix.gcc_arch }}/plugins/ ${{ env.INSTALL_APPIMAGE_DIR }}/usr/
cp /usr/lib/${{ matrix.appimage_arch }}-linux-gnu/libcrypto.so ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/
cp /usr/lib/${{ matrix.appimage_arch }}-linux-gnu/libssl.so ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/
# may need to change this
./linuxdeploy-${{ matrix.appimage_arch }}.AppImage --appdir ${{ env.INSTALL_APPIMAGE_DIR }} --output appimage --plugin qt
tar czf QFRCDashboard-System.tar.zst install-appdir/*
- name: Package (macOS)
if: runner.os == 'macOS'
run: |
export PATH="$PATH;${{ runner.workspace }}/Qt/${{ matrix.qt_version }}/*/bin"
export QML_DIR_PATH="${{ github.workspace }}"
export QML_SOURCES_PATHS="${{ runner.workspace }}/Qt/${{ matrix.qt_version }}/macos/qml"
cd ${{ env.BUILD_DIR }}
chmod a+x Dashboard.app/Contents/MacOS/Dashboard
mkdir Dashboard.app/Contents/Resources -p
cp ../program_info/QFRCDashboard.icns Dashboard.app/Contents/Resources
macdeployqt Dashboard.app -qmldir=$QML_DIR_PATH -qmlimport=$QML_SOURCES_PATHS -verbose=1 -appstore-compliant
ls
mv Dashboard.app ../QFRCDashboard.app
cd ..
tar czf QFRCDashboard.tar.gz QFRCDashboard.app
# TODO: make this work
#mkdir dmg-src
#mv Dashboard.app dmg-src
#cp ../program_info/QFRCDashboard.icns .
# sudo npm install --global create-dmg
# create-dmg --dmg-title=QFRCDashboard Dashboard.app ..
#create-dmg \
# --volname "QFRCDashboard" \
# --volicon "QFRCDashboard.icns" \
# --window-pos 200 120 \
# --window-size 800 400 \
# --icon-size 100 \
# --icon "Dashboard.app" 200 190 \
# --hide-extension "Dashboard.app" \
# --app-drop-link 600 185 \
# "QFRCDashboard.dmg" \
# "dmg-src/"
#
#cd ..
#mv QFRCDashboard*.dmg QFRCDashboard-macOS-${{ env.VERSION }}-${{ inputs.build_type }}-${{ matrix.arch }}.dmg
- name: Package (Windows, Portable)
if: runner.os == 'Windows'
shell: cmd
run: |
cmake --install ${{ env.BUILD_DIR }}\_deps\ntcore-build --prefix ${{ env.NTCORE_INSTALL_DIR }}
mkdir ${{ env.INSTALL_DIR }}
set PATH=%PATH%;"${{ runner.workspace }}\Qt\${{ matrix.qt_version }}\${{ matrix.qt_arch }}\bin"
windeployqt ${{ env.BUILD_DIR }}\Dashboard.exe --dir ${{ env.INSTALL_DIR }} --qmldir ${{ github.workspace }} --qmlimport %QML2_IMPORT_PATH%
cp ${{ env.BUILD_DIR }}\Dashboard.exe ${{ env.INSTALL_DIR }}
cp -r ${{ runner.workspace }}\Qt\${{ matrix.qt_version }}\${{ matrix.msvc_arch }}\qml ${{ env.INSTALL_DIR }}
if "${{ inputs.build_type }}" == "Debug" (
cp C:\Windows\System32\ucrtbased.dll ${{ env.INSTALL_DIR }}
) else (
cp C:\Windows\System32\ucrtbase.dll ${{ env.INSTALL_DIR }}
)
- name: Package (Windows, Installer)
if: runner.os == 'Windows'
shell: cmd
run: |
cd ${{ env.INSTALL_DIR }}
makensis -NOCD "${{ env.BUILD_DIR }}/program_info/win_install.nsi"
##
# UPLOAD
##
- name: Upload portable tarball (Linux)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: QFRCDashboard-Linux-Binary-${{ env.VERSION }}-${{ inputs.build_type }}-${{ matrix.arch }}
path: QFRCDashboard.tar.zst
- name: Upload system tarball (Linux)
if: runner.os == 'Linux' && matrix.arch == 'aarch64'
uses: actions/upload-artifact@v4
with:
name: QFRCDashboard-Linux-System-${{ env.VERSION }}-${{ inputs.build_type }}-${{ matrix.arch }}
path: QFRCDashboard-System.tar.zst
- name: Upload AppImage (Linux)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: QFRCDashboard-Linux-${{ env.VERSION }}-${{ inputs.build_type }}-${{ matrix.arch }}.AppImage
path: QFRCDashboard-Linux-${{ env.VERSION }}-${{ inputs.build_type }}-${{ matrix.arch }}.AppImage
- name: Upload app (macOS)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: QFRCDashboard-macOS-${{ env.VERSION }}-${{ inputs.build_type }}-${{ matrix.arch }}.app
path: QFRCDashboard.tar.gz
#- name: Upload DMG (macOS)
# if: runner.os == 'macOS'
# uses: actions/upload-artifact@v4
# with:
# name: QFRCDashboard-macOS-${{ env.VERSION }}-${{ inputs.build_type }}-${{ matrix.arch }}.dmg
# path: QFRCDashboard*.dmg
- name: Upload binary zip (Windows, portable)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: QFRCDashboard-Windows-Portable-${{ env.VERSION }}-${{ inputs.build_type }}-${{ matrix.arch }}
path: ${{ env.INSTALL_DIR }}/**
- name: Upload installer (Windows)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: QFRCDashboard-Windows-Setup-${{ env.VERSION }}-${{ inputs.build_type }}-${{ matrix.arch }}
path: Dashboard-Setup.exe