Refactor/Create APT/DNF Repository (#1648)

This commit is contained in:
Paulchen-Panther
2023-11-16 21:05:56 +01:00
committed by GitHub
parent c9518db597
commit 91270966f9
165 changed files with 1918 additions and 2924 deletions

59
.github/scripts/build.sh vendored Executable file
View File

@@ -0,0 +1,59 @@
#!/bin/bash
# set environment variables if not exists
[ -z "${BUILD_TYPE}" ] && BUILD_TYPE="Debug"
[ -z "${TARGET_ARCH}" ] && TARGET_ARCH="linux/amd64"
[ -z "${PLATFORM}" ] && PLATFORM="x11"
# Determine cmake build type; tag builds are Release, else Debug (-dev appends to platform)
if [[ $GITHUB_REF == *"refs/tags"* ]]; then
BUILD_TYPE=Release
else
PLATFORM=${PLATFORM}-dev
fi
echo "Compile Hyperion on '${RUNNER_OS}' with build type '${BUILD_TYPE}' and platform '${PLATFORM}'"
# Build the package on MacOS, Windows or Linux
if [[ "$RUNNER_OS" == 'macOS' ]]; then
mkdir build || exit 1
cd build
cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ../ || exit 2
make -j $(sysctl -n hw.ncpu) package || exit 3
cd ${GITHUB_WORKSPACE} && source /${GITHUB_WORKSPACE}/test/testrunner.sh || exit 4
exit 0;
exit 1 || { echo "---> Hyperion compilation failed! Abort"; exit 5; }
elif [[ $RUNNER_OS == "Windows" ]]; then
echo "Number of Cores $NUMBER_OF_PROCESSORS"
mkdir build || exit 1
cd build
cmake -G "Visual Studio 17 2022" -A x64 -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE="Release" ../ || exit 2
cmake --build . --target package --config "Release" -- -nologo -v:m -maxcpucount || exit 3
exit 0;
exit 1 || { echo "---> Hyperion compilation failed! Abort"; exit 5; }
elif [[ "$RUNNER_OS" == 'Linux' ]]; then
echo "Docker arguments used: DOCKER_IMAGE=${DOCKER_IMAGE}, DOCKER_TAG=${DOCKER_TAG}, TARGET_ARCH=${TARGET_ARCH}"
# verification bypass of external dependencies
git config --global --add safe.directory "${GITHUB_WORKSPACE}/dependencies/external/*"
# set GitHub Container Registry url
REGISTRY_URL="ghcr.io/hyperion-project/${DOCKER_IMAGE}"
# take ownership of deploy dir
mkdir ${GITHUB_WORKSPACE}/deploy
# run docker
docker run --rm --platform=${TARGET_ARCH} \
-v "${GITHUB_WORKSPACE}/deploy:/deploy" \
-v "${GITHUB_WORKSPACE}:/source:rw" \
$REGISTRY_URL:$DOCKER_TAG \
/bin/bash -c "mkdir -p /source/build && cd /source/build &&
cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ../ || exit 2 &&
cmake --build /source/build --target package -- -j $(nproc) || exit 3 &&
cp /source/build/bin/h* /deploy/ 2>/dev/null || : &&
cp /source/build/Hyperion-* /deploy/ 2>/dev/null || : &&
cd /source && source /source/test/testrunner.sh || exit 5 &&
exit 0;
exit 1 " || { echo "---> Hyperion compilation failed! Abort"; exit 5; }
# overwrite file owner to current user
sudo chown -fR $(stat -c "%U:%G" ${GITHUB_WORKSPACE}/deploy) ${GITHUB_WORKSPACE}/deploy
fi

View File

@@ -1,154 +0,0 @@
name: Hyperion APT Build
on:
workflow_call:
inputs:
head_sha:
type: string
description: The branch, tag or SHA to checkout
required: true
secrets:
APT_GPG:
required: true
APT_USER:
required: true
APT_PASSWORD:
required: true
APT_DRAFT:
required: true
workflow_dispatch:
inputs:
head_sha:
type: string
description: The branch, tag or SHA to checkout
required: true
secrets:
APT_GPG:
required: true
APT_USER:
required: true
APT_PASSWORD:
required: true
APT_DRAFT:
required: true
jobs:
setup:
name: Setup APT build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set APT matrix
id: apt-ppa
run: |
APT=$(jq -n '.include |= [ inputs[] | select(.["exclude"] != true)]' .github/workflows/apt/*.json --compact-output)
echo "apt=$APT" >> $GITHUB_OUTPUT
outputs:
apt-matrix: ${{ steps.apt-ppa.outputs.apt }}
build:
name: ${{ matrix.description }}
needs: [setup]
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.setup.outputs.apt-matrix) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.head_sha || github.event.client_payload.head_sha }}
submodules: true
- name: Generate environment variables
run: |
tr -d '\n' < .version > temp && mv temp .version
VERSION=$(cat .version)
echo VERSION=${VERSION} >> $GITHUB_ENV
if [[ $VERSION == *"-"* ]]; then
echo STANDARDS_VERSION=$(echo ${VERSION%-*}) >> $GITHUB_ENV
echo TARBALL_VERSION=$(echo ${VERSION%-*}) >> $GITHUB_ENV
echo DEBIAN_FORMAT='3.0 (quilt)' >> $GITHUB_ENV
else
echo STANDARDS_VERSION=$(echo ${VERSION%+*}) >> $GITHUB_ENV
echo TARBALL_VERSION=${VERSION}~$(echo ${{ matrix.distribution }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo DEBIAN_FORMAT='3.0 (native)' >> $GITHUB_ENV
fi
echo DISTRIBUTION=$(echo ${{ matrix.distribution }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build package
shell: bash
run: |
mkdir -p "${GITHUB_WORKSPACE}/deploy"
docker run --rm \
-v "${GITHUB_WORKSPACE}/deploy:/deploy" \
-v "${GITHUB_WORKSPACE}:/source:rw" \
ghcr.io/hyperion-project/${{ matrix.architecture }}:${{ env.DISTRIBUTION }} \
/bin/bash -c "cd /source && \
mkdir -p debian/source && echo '${{ env.DEBIAN_FORMAT }}' > debian/source/format && \
dch --create --distribution ${{ env.DISTRIBUTION }} --package 'hyperion' -v '${{ env.VERSION }}~${{ env.DISTRIBUTION }}' '${{ github.event.commits[0].message }}' && \
cp -fr LICENSE debian/copyright && \
sed 's/@BUILD_DEPENDS@/${{ matrix.build-depends }}/g; s/@DEPENDS@/${{ matrix.package-depends }}/g; s/@ARCHITECTURE@/${{ matrix.architecture }}/g; s/@STANDARDS_VERSION@/${{ env.STANDARDS_VERSION }}/g' debian/control.in > debian/control && \
sed 's/@CMAKE_ENVIRONMENT@/${{ matrix.cmake-environment }}/g' debian/rules.in > debian/rules && \
tar -cJf ../hyperion_${{ env.TARBALL_VERSION }}.orig.tar.xz . && \
debuild --no-lintian -uc -us && \
cp ../hyperion_*.deb /deploy"
- name: Upload package artifact
if: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v3
with:
path: deploy
retention-days: 1
publish:
name: Publish APT packages
if: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'workflow_dispatch' }}
needs: [setup, build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.head_sha || github.event.client_payload.head_sha }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6.0.0
with:
gpg_private_key: ${{ secrets.APT_GPG }}
- name: Install reprepro
run: sudo apt -y install reprepro
- name: Make build folders, export public GPG key and copy distributions file
run: |
mkdir -p apt/{conf,dists,db}
gpg --armor --output apt/hyperion.pub.key --export 'admin@hyperion-project.org'
cp debian/distributions apt/conf/distributions
- name: Create initial structure/packages files and symbolic links
run: |
reprepro -Vb apt createsymlinks
reprepro -Vb apt export
- name: Download artifacts
uses: actions/download-artifact@v3.0.2
- name: Include artifacts into the package source
run: |
for file in artifact/hyperion_*.deb; do
if [ -f "$file" ]; then
dist=${file#*~}
dist=${dist%_*}
reprepro -Vb apt/ includedeb "$dist" "$file"
fi
done
- name: Upload packages to APT server (DRAFT)
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
with:
server: apt.hyperion-project.org
username: ${{ secrets.APT_USER }}
password: ${{ secrets.APT_PASSWORD }}
local-dir: "./apt/"
server-dir: ${{ secrets.APT_DRAFT }}
dangerous-clean-slate: true

View File

@@ -1,58 +0,0 @@
[
{
"distribution": "Focal",
"architecture": "amd64",
"build-depends": "git, cmake, build-essential, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, libqt5x11extras5-dev, libusb-1.0-0-dev, python3-dev, libcec-dev, libxcb-image0-dev, libxcb-util0-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-randr0-dev, libxrandr-dev, libxrender-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libssl-dev, libmbedtls-dev",
"package-depends": "libpython3.8, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls12, libasound2, libturbojpeg, libcec4",
"cmake-environment": "-DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Ubuntu 20.04 (Focal Fossa) (amd64)"
},
{
"distribution": "Jammy",
"architecture": "amd64",
"build-depends": "git, cmake, build-essential, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, libqt5x11extras5-dev, libusb-1.0-0-dev, python3-dev, libcec-dev, libxcb-image0-dev, libxcb-util0-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-randr0-dev, libxrandr-dev, libxrender-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libssl-dev, libmbedtls-dev",
"package-depends": "libpython3.10, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls14, libasound2, libturbojpeg, libcec6",
"cmake-environment": "-DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Ubuntu 22.04 (Jammy Jellyfish) (amd64)"
},
{
"distribution": "Kinetic",
"architecture": "amd64",
"build-depends": "git, cmake, build-essential, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, libqt5x11extras5-dev, libusb-1.0-0-dev, python3-dev, libcec-dev, libxcb-image0-dev, libxcb-util0-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-randr0-dev, libxrandr-dev, libxrender-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libssl-dev, libmbedtls-dev",
"package-depends": "libpython3.10, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls14, libasound2, libturbojpeg, libcec6",
"cmake-environment": "-DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Ubuntu 22.10 (Kinetic Kudu) (amd64)"
},
{
"distribution": "Lunar",
"architecture": "amd64",
"build-depends": "git, cmake, build-essential, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, libqt5x11extras5-dev, libusb-1.0-0-dev, python3-dev, libcec-dev, libxcb-image0-dev, libxcb-util0-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-randr0-dev, libxrandr-dev, libxrender-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libssl-dev, libmbedtls-dev",
"package-depends": "libpython3.11, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls14, libasound2, libturbojpeg, libcec6",
"cmake-environment": "-DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Ubuntu 23.04 (Lunar Lobster) (amd64)"
},
{
"distribution": "Buster",
"architecture": "amd64",
"build-depends": "git, cmake, build-essential, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, libqt5x11extras5-dev, libusb-1.0-0-dev, python3-dev, libcec-dev, libxcb-image0-dev, libxcb-util0-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-randr0-dev, libxrandr-dev, libxrender-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libssl-dev, libmbedtls-dev",
"package-depends": "libpython3.7, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls12, libasound2, libturbojpeg0, libcec4",
"cmake-environment": "-DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Debian 10.x (Buster) (amd64)"
},
{
"distribution": "Bullseye",
"architecture": "amd64",
"build-depends": "git, cmake, build-essential, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, libqt5x11extras5-dev, libusb-1.0-0-dev, python3-dev, libcec-dev, libxcb-image0-dev, libxcb-util0-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-randr0-dev, libxrandr-dev, libxrender-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libssl-dev, libmbedtls-dev",
"package-depends": "libpython3.9, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls12, libasound2, libturbojpeg0, libcec6",
"cmake-environment": "-DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Debian 11.x (Bullseye) (amd64)"
},
{
"distribution": "Bookworm",
"architecture": "amd64",
"build-depends": "git, cmake, build-essential, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, libqt5x11extras5-dev, libusb-1.0-0-dev, python3-dev, libcec-dev, libxcb-image0-dev, libxcb-util0-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-randr0-dev, libxrandr-dev, libxrender-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libssl-dev, libmbedtls-dev",
"package-depends": "libpython3.11, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls14, libasound2, libturbojpeg0, libcec6",
"cmake-environment": "-DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Debian 12.x (Bookworm) (amd64)"
}
]

View File

@@ -1,51 +0,0 @@
[
{
"distribution": "Focal",
"architecture": "arm64",
"build-depends": "git, cmake, build-essential, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, libqt5x11extras5-dev, libusb-1.0-0-dev, python3-dev, libcec-dev, libxcb-image0-dev, libxcb-util0-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-randr0-dev, libxrandr-dev, libxrender-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libssl-dev, libmbedtls-dev",
"package-depends": "libpython3.8, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls12, libasound2, libturbojpeg, libcec4",
"cmake-environment": "-DENABLE_DISPMANX=OFF -DENABLE_X11=ON -DENABLE_XCB=ON -DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Ubuntu 20.04 (Focal Fossa) (arm64)"
},
{
"distribution": "Jammy",
"architecture": "arm64",
"build-depends": "git, cmake, build-essential, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, libqt5x11extras5-dev, libusb-1.0-0-dev, python3-dev, libcec-dev, libxcb-image0-dev, libxcb-util0-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-randr0-dev, libxrandr-dev, libxrender-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libssl-dev, libmbedtls-dev",
"package-depends": "libpython3.10, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls14, libasound2, libturbojpeg, libcec6",
"cmake-environment": "-DENABLE_DISPMANX=OFF -DENABLE_X11=ON -DENABLE_XCB=ON -DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Ubuntu 22.04 (Jammy Jellyfish) (arm64)"
},
{
"distribution": "Kinetic",
"architecture": "arm64",
"build-depends": "git, cmake, build-essential, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, libqt5x11extras5-dev, libusb-1.0-0-dev, python3-dev, libcec-dev, libxcb-image0-dev, libxcb-util0-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-randr0-dev, libxrandr-dev, libxrender-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libssl-dev, libmbedtls-dev",
"package-depends": "libpython3.10, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls14, libasound2, libturbojpeg, libcec6",
"cmake-environment": "-DENABLE_DISPMANX=OFF -DENABLE_X11=ON -DENABLE_XCB=ON -DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Ubuntu 22.10 (Kinetic Kudu) (arm64)"
},
{
"distribution": "Buster",
"architecture": "arm64",
"build-depends": "git, cmake, python3-dev, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, build-essential, libusb-1.0-0-dev, libcec-dev, libssl-dev, libraspberrypi-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libmbedtls-dev",
"package-depends": "libpython3.7, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls12, libasound2, libturbojpeg0, libcec4",
"cmake-environment": "-DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Debian 10.x (Buster) (arm64)"
},
{
"distribution": "Bullseye",
"architecture": "arm64",
"build-depends": "git, cmake, python3-dev, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, build-essential, libusb-1.0-0-dev, libcec-dev, libssl-dev, libraspberrypi-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libmbedtls-dev",
"package-depends": "libpython3.9, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls12, libasound2, libturbojpeg0, libcec6",
"cmake-environment": "-DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Debian 11.x (Bullseye) (arm64)"
},
{
"distribution": "Bookworm",
"architecture": "arm64",
"build-depends": "git, cmake, python3-dev, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, build-essential, libusb-1.0-0-dev, libcec-dev, libssl-dev, libraspberrypi-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libmbedtls-dev",
"package-depends": "libpython3.11, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls14, libasound2, libturbojpeg0, libcec6",
"cmake-environment": "-DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Debian 12.x (Bookworm) (arm64)",
"exclude" : true
}
]

View File

@@ -1,51 +0,0 @@
[
{
"distribution": "Focal",
"architecture": "armhf",
"build-depends": "git, cmake, build-essential, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, libqt5x11extras5-dev, libusb-1.0-0-dev, python3-dev, libcec-dev, libxcb-image0-dev, libxcb-util0-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-randr0-dev, libxrandr-dev, libxrender-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libssl-dev, libmbedtls-dev",
"package-depends": "libpython3.8, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls12, libasound2, libturbojpeg, libcec4",
"cmake-environment": "-DENABLE_DISPMANX=OFF -DENABLE_X11=ON -DENABLE_XCB=ON -DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Ubuntu 20.04 (Focal Fossa) (armhf)"
},
{
"distribution": "Jammy",
"architecture": "armhf",
"build-depends": "git, cmake, build-essential, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, libqt5x11extras5-dev, libusb-1.0-0-dev, python3-dev, libcec-dev, libxcb-image0-dev, libxcb-util0-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-randr0-dev, libxrandr-dev, libxrender-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libssl-dev, libmbedtls-dev",
"package-depends": "libpython3.10, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls14, libasound2, libturbojpeg, libcec6",
"cmake-environment": "-DENABLE_DISPMANX=OFF -DENABLE_X11=ON -DENABLE_XCB=ON -DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Ubuntu 22.04 (Jammy Jellyfish) (armhf)"
},
{
"distribution": "Kinetic",
"architecture": "armhf",
"build-depends": "git, cmake, build-essential, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, libqt5x11extras5-dev, libusb-1.0-0-dev, python3-dev, libcec-dev, libxcb-image0-dev, libxcb-util0-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-randr0-dev, libxrandr-dev, libxrender-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libssl-dev, libmbedtls-dev",
"package-depends": "libpython3.10, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls14, libasound2, libturbojpeg, libcec6",
"cmake-environment": "-DENABLE_DISPMANX=OFF -DENABLE_X11=ON -DENABLE_XCB=ON -DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Ubuntu 22.10 (Kinetic Kudu) (armhf)"
},
{
"distribution": "Buster",
"architecture": "armhf",
"build-depends": "git, cmake, python3-dev, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, build-essential, libusb-1.0-0-dev, libcec-dev, libssl1.0-dev, libraspberrypi-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libmbedtls-dev",
"package-depends": "libpython3.7, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls12, libasound2, libturbojpeg0, libcec4",
"cmake-environment": "-DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Debian 10.x (Buster) (armhf)"
},
{
"distribution": "Bullseye",
"architecture": "armhf",
"build-depends": "git, cmake, python3-dev, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, build-essential, libusb-1.0-0-dev, libcec-dev, libssl-dev, libraspberrypi-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libmbedtls-dev",
"package-depends": "libpython3.9, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls12, libasound2, libturbojpeg0, libcec6",
"cmake-environment": "-DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Debian 11.x (Bullseye) (armhf)"
},
{
"distribution": "Bookworm",
"architecture": "armhf",
"build-depends": "git, cmake, python3-dev, qtbase5-dev, libqt5serialport5-dev, libqt5sql5-sqlite, libqt5svg5-dev, build-essential, libusb-1.0-0-dev, libcec-dev, libssl-dev, libraspberrypi-dev, libasound2-dev, libturbojpeg0-dev, libjpeg-dev, libmbedtls-dev",
"package-depends": "libpython3.11, libusb-1.0-0, libqt5widgets5, libqt5x11extras5, libqt5sql5, libqt5sql5-sqlite, libqt5serialport5, libmbedtls14, libasound2, libturbojpeg0, libcec6",
"cmake-environment": "-DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release",
"description": "Debian 12.x (Bookworm) (armhf)",
"exclude" : true
}
]

View File

@@ -1,4 +1,4 @@
name: Clean artifacts
name: 🧹 Cleanup old artifacts
# Run cleanup workflow at the end of every day
on:
@@ -9,7 +9,7 @@ jobs:
clean:
runs-on: ubuntu-latest
steps:
- name: cleanup
- name: 🧹 Cleanup old workflow artifacts
uses: kolpav/purge-artifacts-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,4 +1,8 @@
name: "CodeQL"
name: 📊 CodeQL
run-name: |
${{ github.event_name == 'schedule' && '⏰ Scheduled CodeQL run' || '' }}
${{ github.event_name == 'push' && format('📊 Pushed CodeQL run - {0}', github.event.head_commit.message) || '' }}
${{ github.event_name == 'pull_request' && format('📊 CodeQL run for PR {0} - {1}', github.event.pull_request.number, github.event.pull_request.title) || github.event.head_commit.message }}
on:
push:
@@ -10,7 +14,7 @@ on:
jobs:
analyze:
name: Analyze
name: 📊 Analyze
runs-on: ubuntu-latest
permissions:
actions: read
@@ -23,35 +27,35 @@ jobs:
language: [ python, javascript, cpp ]
steps:
- name: Checkout
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Packages (cpp)
- name: 📥 Install Packages (cpp)
if: ${{ matrix.language == 'cpp' }}
run: |
sudo apt-get update
sudo apt-get install --yes git cmake build-essential qtbase5-dev libqt5serialport5-dev libqt5sql5-sqlite libqt5svg5-dev libqt5x11extras5-dev libusb-1.0-0-dev python3-dev libcec-dev libxcb-image0-dev libxcb-util0-dev libxcb-shm0-dev libxcb-render0-dev libxcb-randr0-dev libxrandr-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libasound2-dev libturbojpeg0-dev libjpeg-dev libssl-dev
- name: Initialize CodeQL
- name: 🔁 Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality
config-file: ./.github/config/codeql.yml
- name: Autobuild
- name: 👷 Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
- name: 🏃 Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
upload: False
output: sarif-results
- name: Filter SARIF
- name: 🆔 Filter SARIF
uses: advanced-security/filter-sarif@v1
with:
patterns: |
@@ -63,11 +67,12 @@ jobs:
input: sarif-results/${{ matrix.language }}.sarif
output: sarif-results/${{ matrix.language }}.sarif
- name: Upload SARIF
- name: 📦 Upload SARIF
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: sarif-results/${{ matrix.language }}.sarif
- name: Upload loc as a Build Artifact
- name: 📦 Upload loc as a Build Artifact
uses: actions/upload-artifact@v3
with:
name: sarif-results

View File

@@ -1,187 +0,0 @@
name: Nightly build
# Create nightly builds at the end of every day
on:
schedule:
- cron: '0 0 * * *'
repository_dispatch:
types: [hyperion_nightly_push]
jobs:
update:
name: Update Submodule rpi_ws281x
if: github.repository_owner == 'hyperion-project'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
submodules: recursive
- name: Update Submodule rpi_ws281x
id: update
run: git submodule update --remote --recursive dependencies/external/rpi_ws281x
- name: Check git status
id: status
run: echo "status=$(git status -s)" >> $GITHUB_OUTPUT
- name: Add and commit changes
if: ${{ steps.status.outputs.status }}
run: |
git config --local user.email "20935312+Hyperion-Bot@users.noreply.github.com"
git config --local user.name "Hyperion-Bot"
git config --local diff.ignoreSubmodules dirty
git commit -am "Update submodule rpi_ws281x"
- name: Push changes
if: ${{ steps.status.outputs.status }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.HYPERION_BOT_TOKEN }}
branch: ${{ github.ref }}
check:
name: Compare local <-> nightly
needs: [update]
if: github.repository_owner == 'hyperion-project'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check if commit has changed
id: build-necessary
run: |
if wget --spider "https://nightly.apt.hyperion-project.org/$(git rev-parse --short HEAD)" 2>/dev/null; then
echo "commit-has-changed=false" >> $GITHUB_OUTPUT
else
echo "commit-has-changed=true" >> $GITHUB_OUTPUT
fi
outputs:
build-nightly: ${{ steps.build-necessary.outputs.commit-has-changed }}
setup:
name: Setup nightly build
needs: [check]
if: ${{ needs.check.outputs.build-nightly == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set nightly matrix
id: nightly-ppa
run: |
NIGHTLY=$(jq -n '.include |= [ inputs[] | select(.["exclude"] != true)]' .github/workflows/apt/*.json --compact-output)
echo "nightly=$NIGHTLY" >> $GITHUB_OUTPUT
outputs:
nightly-matrix: ${{ steps.nightly-ppa.outputs.nightly }}
build:
name: ${{ matrix.description }}
needs: [setup]
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.setup.outputs.nightly-matrix) }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Generate environment variables
run: |
echo "$(tr -d '\n' < .version)+nightly$(date '+%Y%m%d')$(git rev-parse --short HEAD)" > .version
VERSION=$(cat .version)
echo VERSION=${VERSION} >> $GITHUB_ENV
if [[ $VERSION == *"-"* ]]; then
echo STANDARDS_VERSION=$(echo ${VERSION%-*}) >> $GITHUB_ENV
echo TARBALL_VERSION=$(echo ${VERSION%-*}) >> $GITHUB_ENV
echo DEBIAN_FORMAT='3.0 (quilt)' >> $GITHUB_ENV
else
echo STANDARDS_VERSION=$(echo ${VERSION%+*}) >> $GITHUB_ENV
echo TARBALL_VERSION=${VERSION}~$(echo ${{ matrix.distribution }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo DEBIAN_FORMAT='3.0 (native)' >> $GITHUB_ENV
fi
echo DISTRIBUTION=$(echo ${{ matrix.distribution }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build package
shell: bash
run: |
mkdir -p "${GITHUB_WORKSPACE}/deploy"
docker run --rm \
-v "${GITHUB_WORKSPACE}/deploy:/deploy" \
-v "${GITHUB_WORKSPACE}:/source:rw" \
ghcr.io/hyperion-project/${{ matrix.architecture }}:${{ env.DISTRIBUTION }} \
/bin/bash -c "cd /source && \
mkdir -p debian/source && echo '${{ env.DEBIAN_FORMAT }}' > debian/source/format && \
dch --create --distribution ${{ env.DISTRIBUTION }} --package 'hyperion' -v '${{ env.VERSION }}~${{ env.DISTRIBUTION }}' '${{ github.event.commits[0].message }}' && \
cp -fr LICENSE debian/copyright && \
sed 's/@BUILD_DEPENDS@/${{ matrix.build-depends }}/g; s/@DEPENDS@/${{ matrix.package-depends }}/g; s/@ARCHITECTURE@/${{ matrix.architecture }}/g; s/@STANDARDS_VERSION@/${{ env.STANDARDS_VERSION }}/g' debian/control.in > debian/control && \
sed 's/@CMAKE_ENVIRONMENT@/${{ matrix.cmake-environment }}/g' debian/rules.in > debian/rules && \
tar -cJf ../hyperion_${{ env.TARBALL_VERSION }}.orig.tar.xz . && \
debuild --no-lintian -uc -us && \
cp ../hyperion_*.deb /deploy"
- name: Upload package artifact
uses: actions/upload-artifact@v3
with:
path: deploy
retention-days: 1
publish:
name: Publish nightly packages
needs: [setup, build]
if: github.repository_owner == 'hyperion-project'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6.0.0
with:
gpg_private_key: ${{ secrets.APT_GPG }}
- name: Install reprepro
run: sudo apt -y install reprepro
- name: Make build folders, export public GPG key, copy distributions file and create short sha file for nightly build check
run: |
mkdir -p nightly/{conf,dists,db}
gpg --armor --output nightly/hyperion.pub.key --export 'admin@hyperion-project.org'
cp debian/distributions nightly/conf/distributions
touch "nightly/$(git rev-parse --short HEAD)"
- name: Create initial structure/packages files and symbolic links
run: |
reprepro -Vb nightly createsymlinks
reprepro -Vb nightly export
- name: Download artifacts
uses: actions/download-artifact@v3.0.2
- name: Include artifacts into the package source
run: |
for file in artifact/*.deb; do
if [ -f "$file" ]; then
dist=${file#*~}
dist=${dist%_*}
reprepro -Vb nightly/ includedeb "$dist" "$file"
fi
done
- name: Upload packages to nightly server
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
with:
server: nightly.apt.hyperion-project.org
username: ${{ secrets.NIGHTLY_USER }}
password: ${{ secrets.NIGHTLY_PASSWORD }}
local-dir: "./nightly/"
server-dir: "./"
dangerous-clean-slate: true
- name: Remove intermediate artifacts
uses: geekyeggo/delete-artifact@v2
with:
name: artifact
failOnError: false

View File

@@ -1,193 +0,0 @@
name: Hyperion PR Build
on:
pull_request:
branches:
- master
jobs:
######################
###### Linux #########
######################
Linux:
name: ${{ matrix.dockerName }}
runs-on: ubuntu-latest
strategy:
matrix:
dockerImage: [ x86_64, armv6l, armv7l, aarch64 ]
include:
- dockerImage: x86_64
dockerName: Debian Buster (x86_64)
platform: x11
- dockerImage: armv6l
dockerName: Debian Buster (Raspberry Pi v1 & ZERO)
platform: rpi
- dockerImage: armv7l
dockerName: Debian Buster (Raspberry Pi 2 & 3)
platform: rpi
- dockerImage: aarch64
dockerName: Debian Buster (Generic AARCH64)
platform: amlogic
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
# Append PR number to .version
- name: Append PR number to version
shell: bash
run: |
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
# Build packages
- name: Build packages
env:
DOCKER_IMAGE: ${{ matrix.dockerImage }}
DOCKER_TAG: buster
DOCKER_NAME: ${{ matrix.dockerName }}
PLATFORM: ${{ matrix.platform }}
shell: bash
run: ./.ci/ci_build.sh
# Collecting deployable artifacts
- name: Collecting deployable artifacts
shell: bash
run: |
mkdir -p ${{ matrix.dockerImage }}
mv deploy/*.tar.gz ${{ matrix.dockerImage }}
# Upload artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.dockerImage }}
path: ${{ matrix.dockerImage }}
######################
###### macOS #########
######################
macOS:
name: macOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
# Append PR number to .version
- name: Append PR number to version
shell: bash
run: |
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
# Install dependencies
- name: Install dependencies
shell: bash
run: ./.ci/ci_install.sh
# Build packages
- name: Build packages
env:
PLATFORM: osx
shell: bash
run: ./.ci/ci_build.sh
# Collecting deployable artifacts
- name: Collecting deployable artifacts
shell: bash
run: |
mkdir -p macOS
mv build/*.dmg macOS
# Upload artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: macOS
path: macOS
######################
###### Windows #######
######################
windows:
name: Windows
runs-on: windows-2022
env:
VCINSTALLDIR: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
QT_VERSION: 5.15.2
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
# Append PR number to .version
- name: Append PR number to version
shell: bash
run: |
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
target: 'desktop'
arch: 'win64_msvc2019_64'
cache: 'true'
cache-key-prefix: 'cache-qt-windows'
- name: Cache Chocolatey downloads
uses: actions/cache@v3
with:
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
key: ${{ runner.os }}-chocolatey
# - name: Install Python
# shell: powershell
# run: |
# choco install --no-progress python -y
- name: Install OpenSSL, DirectX SDK
shell: powershell
run: |
choco install --no-progress openssl --version=1.1.1.2100 -y
choco install --no-progress directx-sdk -y
- name: Install libjpeg-turbo
run: |
Invoke-WebRequest https://netcologne.dl.sourceforge.net/project/libjpeg-turbo/2.0.6/libjpeg-turbo-2.0.6-vc64.exe -OutFile libjpeg-turbo.exe -UserAgent NativeHost
.\libjpeg-turbo /S
- name: Set up x64 build architecture environment
shell: cmd
run: call "${{env.VCINSTALLDIR}}\Auxiliary\Build\vcvars64.bat"
# Build packages
- name: Build packages
env:
PLATFORM: windows
shell: bash
run: ./.ci/ci_build.sh
# Collecting deployable artifacts
- name: Collecting deployable artifacts
shell: bash
run: |
mkdir -p windows
mv build/*.exe windows
# Upload artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: windows
path: windows

View File

@@ -1,201 +0,0 @@
name: Hyperion CI Build
on:
push:
branches:
- '**'
tags:
- '*'
jobs:
###################
###### Linux ######
###################
Linux:
name: ${{ matrix.dockerName }}
runs-on: ubuntu-latest
strategy:
matrix:
dockerImage: [ x86_64, armv6l, armv7l, aarch64 ]
include:
- dockerImage: x86_64
dockerName: Debian Buster (x86_64)
platform: x11
- dockerImage: armv6l
dockerName: Debian Buster (Raspberry Pi v1 & ZERO)
platform: rpi
- dockerImage: armv7l
dockerName: Debian Buster (Raspberry Pi 2 & 3)
platform: rpi
- dockerImage: aarch64
dockerName: Debian Buster (Generic AARCH64)
platform: amlogic
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# Build process
- name: Build packages
env:
DOCKER_IMAGE: ${{ matrix.dockerImage }}
DOCKER_TAG: buster
DOCKER_NAME: ${{ matrix.dockerName }}
PLATFORM: ${{ matrix.platform }}
shell: bash
run: ./.ci/ci_build.sh
# Upload artifacts (only on tagged commit)
- name: Upload artifacts
if: startsWith(github.event.ref, 'refs/tags')
uses: actions/upload-artifact@v3
with:
path: deploy/Hyperion-*
###################
###### macOS ######
###################
macOS:
name: macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# Install dependencies
- name: Install dependencies
shell: bash
run: ./.ci/ci_install.sh
# Build process
- name: Build packages
env:
PLATFORM: osx
shell: bash
run: ./.ci/ci_build.sh
# Upload artifacts (only on tagged commit)
- name: Upload artifacts
if: startsWith(github.event.ref, 'refs/tags')
uses: actions/upload-artifact@v3
with:
path: build/Hyperion-*
#####################
###### Windows ######
#####################
windows:
name: Windows
runs-on: windows-2022
env:
VCINSTALLDIR: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
QT_VERSION: 5.15.2
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
target: 'desktop'
arch: 'win64_msvc2019_64'
cache: 'true'
cache-key-prefix: 'cache-qt-windows'
- name: Cache Chocolatey downloads
uses: actions/cache@v3
with:
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
key: ${{ runner.os }}-chocolatey
# - name: Install Python
# shell: powershell
# run: |
# choco install --no-progress python -y
- name: Install OpenSSL, DirectX SDK
shell: powershell
run: |
choco install --no-progress openssl --version=1.1.1.2100 -y
choco install --no-progress directx-sdk -y
- name: Install libjpeg-turbo
run: |
Invoke-WebRequest https://netcologne.dl.sourceforge.net/project/libjpeg-turbo/2.0.6/libjpeg-turbo-2.0.6-vc64.exe -OutFile libjpeg-turbo.exe -UserAgent NativeHost
.\libjpeg-turbo /S
- name: Set up x64 build architecture environment
shell: cmd
run: call "${{env.VCINSTALLDIR}}\Auxiliary\Build\vcvars64.bat"
# Build packages
- name: Build packages
env:
PLATFORM: windows
shell: bash
run: ./.ci/ci_build.sh
# Upload artifacts (only on tagged commit)
- name: Upload artifacts
if: startsWith(github.event.ref, 'refs/tags')
uses: actions/upload-artifact@v3
with:
path: build/Hyperion-*
retention-days: 1
#####################################
###### Publish GitHub Releases ######
#####################################
github_publish:
name: Publish GitHub Releases
if: startsWith(github.event.ref, 'refs/tags')
needs: [Linux, macOS, windows]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# Generate environment variables
- name: Generate environment variables from .version and tag
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "VERSION=$(tr -d '\n' < .version)" >> $GITHUB_ENV
# Download artifacts from previous build process
- name: Download artifacts
uses: actions/download-artifact@v3.0.2
with:
path: artifacts
# Create draft release and upload artifacts
- name: Create draft release
uses: softprops/action-gh-release@v1
with:
name: Hyperion ${{ env.VERSION }}
tag_name: ${{ env.TAG }}
files: "artifacts/**"
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
##########################
###### APT workflow ######
##########################
apt_build:
name: APT Build GitHub Releases
if: startsWith(github.event.ref, 'refs/tags')
needs: [Linux, macOS, windows]
uses: ./.github/workflows/apt.yml
secrets: inherit
with:
head_sha: master

49
.github/workflows/push_pull.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: Hyperion CI/PR Builds
run-name: |
${{ github.event_name == 'push' && '🌱 Push build -' || '' }}
${{ github.event_name == 'pull_request' && format('📦 Artifacts build for PR {0} - {1}', github.event.pull_request.number, github.event.pull_request.title) || github.event.head_commit.message }}
on:
push:
branches:
- '**'
tags:
- '*'
pull_request:
branches:
- 'master'
jobs:
# GitHub Push/Pull Request (Release only on tagged commits)
github_build:
name: Qt ${{ matrix.qt_version }} Build ${{ matrix.qt_version == '6' && '(Testing))' || '' }}
strategy:
fail-fast: false
matrix:
qt_version: ['5', '6']
uses: ./.github/workflows/qt5_6.yml
secrets: inherit
with:
qt_version: ${{ matrix.qt_version }}
event_name: ${{ github.event_name }}
pull_request_number: ${{ github.event.pull_request.number }}
publish: ${{ startsWith(github.event.ref, 'refs/tags') }}
# Build DEB/RPM Packages for APT/DNF Repository (runs only on tagged commits)
repo_build:
name: 🚀 Let Hyperion build its own repository (APT/DNF)
if: startsWith(github.event.ref, 'refs/tags')
needs: [ github_build ]
runs-on: ubuntu-latest
steps:
- name: 📲 Dispatch APT/DNF build
if: ${{ env.SECRET_HYPERION_BOT_TOKEN != null }}
uses: peter-evans/repository-dispatch@v2.1.2
with:
repository: hyperion-project/hyperion.releases-ci
token: ${{ secrets.HYPERION_BOT_TOKEN }}
event-type: releases_repo_build
client-payload: '{ "head_sha": "${{ github.sha }}" }'
env:
SECRET_HYPERION_BOT_TOKEN: ${{ secrets.HYPERION_BOT_TOKEN }}

250
.github/workflows/qt5_6.yml vendored Normal file
View File

@@ -0,0 +1,250 @@
name: GitHub Qt5/6 Builds
on:
# Reusable from push_pull.yml
workflow_call:
inputs:
qt_version:
type: string
description: Build with this Qt version
default: '5'
required: false
event_name:
type: string
description: The event name
default: ''
required: false
pull_request_number:
type: string
description: The corresponding PR number
default: ''
required: false
publish:
type: boolean
description: Package publishing
default: false
required: false
env:
ghcr: hyperion-project
jobs:
######################
###### Linux #########
######################
Linux:
name: 🐧 ${{ matrix.os.description }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [
{ distribution: debian, codename: buster, description: Debian Buster (x86_64), architecture: [ amd64, linux/amd64 ] },
{ distribution: debian, codename: bullseye, description: Debian Bullseye (x86_64), architecture: [ amd64, linux/amd64 ] },
{ distribution: debian, codename: buster, description: Debian Buster (Raspberry Pi 1/ZERO), architecture: [ armv6, linux/arm/v5 ] },
{ distribution: debian, codename: buster, description: Debian Buster (Raspberry Pi 2/3/4), architecture: [ armv7, linux/arm/v7 ] },
{ distribution: debian, codename: bullseye, description: Debian Bullseye (Raspberry Pi 2/3/4), architecture: [ armv7, linux/arm/v7 ] },
{ distribution: debian, codename: buster, description: Debian Buster (Generic AARCH64), architecture: [ aarch64, linux/arm64 ] },
{ distribution: debian, codename: bullseye, description: Debian Bullseye (Generic AARCH64), architecture: [ aarch64, linux/arm64 ] }
]
isQt5:
- ${{ inputs.qt_version == '5' }}
include:
- os.architecture[0]: amd64
platform: x11
- os.architecture[0]: armv6
platform: rpi
- os.architecture[0]: armv7
platform: rpi
- os.architecture[0]: aarch64
platform: amlogic
exclude:
- isQt5: true
os: { distribution: debian, codename: bullseye }
- isQt5: false
os: { distribution: debian, codename: buster }
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: 🔧 Prepare
shell: bash
run: |
echo '::group::Append PR number to version (PR only)'
if [[ "${{ inputs.event_name }}" = "pull_request" ]]; then
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ inputs.pull_request_number }}" >> .version
fi
echo '::endgroup::'
- name: 👷 Build
shell: bash
run: ./.github/scripts/build.sh
env:
DOCKER_IMAGE: ${{ matrix.os.distribution }}
DOCKER_TAG: ${{ matrix.os.codename }}${{ inputs.qt_version == '6' && '-qt6' || '' }}
PLATFORM: ${{ matrix.platform }}
TARGET_ARCH: ${{ matrix.os.architecture[1] }}
- name: 📦 Upload
if: ${{ inputs.publish || inputs.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.event_name == 'pull_request' && env.NAME || 'artifact' }}
path: ${{ inputs.event_name == 'pull_request' && 'deploy/*.tar.gz' || 'deploy/Hyperion-*' }}
env:
NAME: ${{ format('{0}_{1}_{2}{3}', matrix.os.distribution, matrix.os.codename, matrix.os.architecture[0], inputs.qt_version == '6' && '_qt6' || '') }}
######################
###### macOS #########
######################
macOS:
name: 🍏 macOS x64
runs-on: macos-latest
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: 🔧 Prepare
shell: bash
run: |
echo '::group::Append PR number to version (PR only)'
if [[ "${{ inputs.event_name }}" = "pull_request" ]]; then
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ inputs.pull_request_number }}" >> .version
fi
echo '::endgroup::'
echo '::group::Update/Install dependencies'
brew update || true
brew install --overwrite qt${{ inputs.qt_version }} libusb
brew link --overwrite --force qt${{ inputs.qt_version }}
echo '::endgroup::'
- name: 👷 Build
shell: bash
run: ./.github/scripts/build.sh
env:
PLATFORM: osx
- name: 📦 Upload
if: ${{ inputs.publish || inputs.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.event_name == 'pull_request' && env.NAME || 'artifact' }}
path: 'build/Hyperion-*'
env:
NAME: ${{ inputs.qt_version == '6' && 'macOS_x64_qt6' || 'macOS_x64' }}
######################
###### Windows #######
######################
windows:
name: 🪟 Windows x64
runs-on: windows-2022
env:
VCINSTALLDIR: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: 🔧 Prepare PR
if: ${{ inputs.event_name == 'pull_request' }}
shell: bash
run: |
echo '::group::Append PR number to version'
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ inputs.pull_request_number }}" >> .version
echo '::endgroup::'
- name: 💾 Cache/Restore
uses: actions/cache@v3
with:
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
key: ${{ runner.os }}${{ inputs.qt_version == '6' && '-chocolatey-qt6' || '-chocolatey' }}
- name: 📥 Install DirectX SDK, OpenSSL, libjpeg-turbo ${{ inputs.qt_version == '6' && 'and Vulkan-SDK' || '' }}
shell: powershell
run: |
choco install --no-progress directx-sdk ${{env.VULKAN_SDK}} -y
choco install --no-progress ${{env.OPENSSL}} -y
Invoke-WebRequest https://netcologne.dl.sourceforge.net/project/libjpeg-turbo/3.0.1/libjpeg-turbo-3.0.1-vc64.exe -OutFile libjpeg-turbo.exe -UserAgent NativeHost
.\libjpeg-turbo /S
env:
VULKAN_SDK: ${{ inputs.qt_version == '6' && 'vulkan-sdk' || '' }}
OPENSSL: ${{ inputs.qt_version == '6' && 'openssl' || 'openssl --version=1.1.1.2100' }}
- name: 📥 Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ inputs.qt_version == '6' && '6.5.2' || '5.15.2' }}
target: 'desktop'
modules: ${{ inputs.qt_version == '6' && 'qtserialport' || '' }}
arch: 'win64_msvc2019_64'
cache: 'true'
cache-key-prefix: 'cache-qt-windows'
- name: 🛠️ Setup MSVC
shell: cmd
run: call "${{env.VCINSTALLDIR}}\Auxiliary\Build\vcvars64.bat"
- name: 👷 Build
shell: bash
run: ./.github/scripts/build.sh
env:
PLATFORM: windows
- name: 📦 Upload
if: ${{ inputs.publish || inputs.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.event_name == 'pull_request' && env.NAME || 'artifact' }}
path: ${{ inputs.event_name == 'pull_request' && 'build/*.exe' || 'build/Hyperion-*' }}
env:
NAME: ${{ inputs.qt_version == '6' && 'windows_x64_qt6' || 'windows_x64' }}
#####################################
###### Publish GitHub Releases ######
#####################################
github_publish:
name: 🚀 Publish GitHub Releases
if: ${{ inputs.qt_version == '5' && inputs.publish }}
needs: [Linux, macOS, windows]
runs-on: ubuntu-latest
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
- name: 🔧 Prepare
run: |
echo '::group::Generate environment variables from .version and tag'
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "VERSION=$(tr -d '\n' < .version)" >> $GITHUB_ENV
echo '::endgroup::'
- name: 💾 Artifact download
uses: actions/download-artifact@v3.0.2
with:
path: artifacts
- name: 📦 Upload
uses: softprops/action-gh-release@v1
with:
name: Hyperion ${{ env.VERSION }}
tag_name: ${{ env.TAG }}
files: "artifacts/**"
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,15 +1,18 @@
name: Release Actions
name: 🚀 Release Actions
run-name: 🚀 Let HyperBian create
on:
release:
types: [published]
jobs:
hyperbian:
name: Let HyperBian create
name: 🚀 Let HyperBian create
runs-on: ubuntu-latest
steps:
# Dispatch event to build new HyperBian image
- name: Dispatch HyperBian build
- name: 📲 Dispatch HyperBian build
uses: peter-evans/repository-dispatch@v2.1.2
if: ${{ github.repository_owner == 'hyperion-project'}}
with: