Skip to content

CI

CI #414

Workflow file for this run

name: CI
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '43 17 * * FRI'
defaults:
run:
working-directory: ./Software
jobs:
build-pacman:
runs-on: ubuntu-20.04
name: pacman Build (Arch Linux)
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Build
working-directory: Software/dist_linux
run: ./build-in-docker.sh pacman archlinux latest
- name: Check Package
run: |
set -xe
PKG_PATH=$(ls dist_linux/pacman/prismatik*.pkg.tar*)
echo "PKG_PATH=Software/$PKG_PATH" >> $GITHUB_ENV
echo "PKG_NAME=$(basename $PKG_PATH)" >> $GITHUB_ENV
- name: Upload Package
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: ${{ env.PKG_PATH }}
build-flatpack:
runs-on: ubuntu-20.04
name: Flatpack Build
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Install Flatpak
run: |
set -xe
sudo apt update
sudo apt install flatpak flatpak-builder
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- name: Build
working-directory: Software/dist_linux
run: ./build-natively.sh flatpak
- name: Check Package
run: |
set -xe
PKG_PATH=$(ls dist_linux/flatpak/prismatik*.flatpak)
echo "PKG_PATH=Software/$PKG_PATH" >> $GITHUB_ENV
echo "PKG_NAME=$(basename $PKG_PATH)" >> $GITHUB_ENV
- name: Upload Package
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: ${{ env.PKG_PATH }}
build-dpkg:
runs-on: ubuntu-20.04
strategy:
matrix:
os: [ 'ubuntu 22.04', 'ubuntu 20.04', 'debian 12.4' ]
name: dpkg Build (${{ matrix.os }})
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Build
working-directory: Software/dist_linux
run: ./build-in-docker.sh dpkg ${{ matrix.os }}
- name: Check Package
run: |
set -xe
PKG_PATH=$(ls dist_linux/dpkg/prismatik*.deb)
echo "PKG_PATH=Software/$PKG_PATH" >> $GITHUB_ENV
echo "PKG_NAME=$(basename $PKG_PATH | sed 's#amd64#${{ matrix.os }}_amd64#; s# ##')" >> $GITHUB_ENV
- name: Upload Package
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: ${{ env.PKG_PATH }}
build-fw:
name: Firmware Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: sudo apt-get install gcc-avr avr-libc build-essential
- run: ./build_batch.sh
working-directory: ./Firmware
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: firmware
path: Firmware/hex/*
build-win:
name: Windows Build
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- run: choco install --no-progress openssl
- uses: ilammy/msvc-dev-cmd@v1
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
cache: true
cache-key-prefix: install-qt-action-default
version: 6.*
modules: qtserialport
- name: Cached Bass
id: cache-bass
uses: actions/cache@v4
with:
path: C:\bass
key: ${{ runner.os }}-bass_24
- name: Install Bass
if: steps.cache-bass.outputs.cache-hit != 'true'
shell: powershell
run: |
If (!(Test-Path -Path "C:\bass" )) {
(New-Object System.Net.WebClient).DownloadFile("https://un4seen.com/files/bass24.zip", "C:\bass.zip")
(New-Object System.Net.WebClient).DownloadFile("https://un4seen.com/files/basswasapi24.zip", "C:\basswasapi.zip")
Expand-Archive C:\bass.zip -DestinationPath C:\bass
Expand-Archive C:\basswasapi.zip -DestinationPath C:\bass\wasapi
}
- name: Cached NightLight
id: cache-nightlight
uses: actions/cache@v4
with:
path: C:\NightLight
key: ${{ runner.os }}-nightlight_1.3_1909
- name: Install NightLight
if: steps.cache-nightlight.outputs.cache-hit != 'true'
shell: powershell
run: |
If (!(Test-Path -Path "C:\NightLight" )) {
(New-Object System.Net.WebClient).DownloadFile("https://github.com/zomfg/NightLightLibrary/releases/download/v1.3/NightLightLibrary-x64-1.3-win1909preview.zip", "C:\NightLight.zip")
Expand-Archive C:\NightLight.zip -DestinationPath C:\NightLight
}
- name: Set build vars
shell: bash
run: |
echo "OPENSSL_DIR = \"C:\\Program Files\\OpenSSL\\bin\"" > build-vars.prf
echo "DEFINES += BASS_SOUND_SUPPORT" >> build-vars.prf
echo "BASS_DIR = \"C:\\bass\"" >> build-vars.prf
echo "BASSWASAPI_DIR = \"C:\\bass\\wasapi\"" >> build-vars.prf
echo "DEFINES += NIGHTLIGHT_SUPPORT" >> build-vars.prf
echo "NIGHTLIGHT_DIR = \"C:\\NightLight\"" >> build-vars.prf
echo "TARGET_ARCH = x86_64" >> build-vars.prf
- name: Build
shell: cmd
run: |
set QTDIR=%Qt6_Dir%
call scripts\win32\generate_sln.bat
MSBuild.exe Lightpack.sln /p:Configuration=Release
- name: Prepare Installer
shell: bash
run: |
scripts/win32/prepare_installer.sh
- name: Build Installer
shell: cmd
run: |
"C:/Program Files (x86)/Inno Setup 6/ISCC.exe" script_qt6.iss
working-directory: ./Software/dist_windows
- name: Check Package
shell: bash
run: |
set -xe
PKG_PATH=$(ls dist_windows/Output/Prismatik*.exe)
PKG_NAME=$(basename "$PKG_PATH")
echo "PKG_PATH=Software/$PKG_PATH" >> $GITHUB_ENV
echo "PKG_NAME=$PKG_NAME" >> $GITHUB_ENV
- name: Upload Package
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: ${{ env.PKG_PATH }}
build-macos:
name: macOS Build
runs-on: macOS-11
env:
QT_DEST: Qt
steps:
- uses: actions/checkout@v4
- name: Select Latest Xcode
run: |
set -xe
sw_vers
ls -d /Applications/Xcode*.app
LAST_XCODE=$(ls -d /Applications/Xcode*.app | grep -v beta | sort -Vr | head -n1)
sudo xcode-select --switch $LAST_XCODE
xcode-select -p
xcodebuild -version
xcodebuild -showsdks
- name: install Qt installer
run: |
set -xe
pip3 install -U pip
pip3 install aqtinstall
pip3 show aqtinstall
aqt list-qt mac desktop
QT_VERSION=$(aqt list-qt mac desktop --spec 6.2 --latest-version)
echo "QT_VERSION=$QT_VERSION" >> $GITHUB_ENV
- name: Cached Qt
id: cache-qt
uses: actions/cache@v4
with:
path: ${{ env.QT_DEST }}
key: ${{ runner.os }}-qt-${{ env.QT_VERSION }}
- name: install Qt
# The cache is relative to the workspace (not the default working dir)
# so the QT installation should be too.
working-directory: ./
run: |
set -xe
QTDIR=$PWD/$QT_DEST/$QT_VERSION/macos
echo "QTDIR=$QTDIR" >> $GITHUB_ENV
if [[ -d "$QTDIR" ]]
then
echo using cached version
else
echo installing fresh version
aqt install-qt mac desktop $QT_VERSION clang_64 --modules qtserialport --outputdir $QT_DEST
fi
- name: Build
run: |
export PATH=$QTDIR/bin:$PATH
qmake -r
make
macdeployqt bin/Prismatik.app -dmg
- name: Check Package
run: |
set -xe
VERSION=`cat RELEASE_VERSION`
PKG_PATH="Software/bin/Prismatik.dmg"
PKG_NAME="Prismatik_${VERSION}.dmg"
echo "PKG_PATH=$PKG_PATH" >> $GITHUB_ENV
echo "PKG_NAME=$PKG_NAME" >> $GITHUB_ENV
- name: Upload Package
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: ${{ env.PKG_PATH }}