refactor apt/dnf repo

This commit is contained in:
Paulchen-Panther
2023-10-15 18:31:50 +02:00
parent 88c6bef9be
commit b6c2e0cc0e
55 changed files with 1298 additions and 854 deletions

View File

@@ -1,154 +1,200 @@
name: Hyperion APT Build
on:
# Reusable from nightly and push
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
default: "master"
required: false
nightly:
type: boolean
description: Nightly build
default: false
required: false
publish:
type: boolean
description: Publish packages
default: false
required: false
# For running the workflow manually via GitHub Actions tab
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
default: "master"
required: false
nightly:
type: boolean
description: Nightly build
default: false
required: false
publish:
type: boolean
description: Publish packages
default: false
required: false
env:
ghcr: paulchen-panther # hyperion-project
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]
name: 🐧 ${{ matrix.os.description }} (${{ matrix.architecture[0] }})
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.setup.outputs.apt-matrix) }}
fail-fast: false
matrix:
os: [
{ distribution: ubuntu, codename: focal, description: Ubuntu 20.04 (Focal Fossa), },
{ distribution: ubuntu, codename: jammy, description: Ubuntu 22.04 (Jammy Jellyfish), },
{ distribution: ubuntu, codename: lunar, description: Ubuntu 23.04 (Lunar Lobster), },
{ distribution: ubuntu, codename: mantic, description: Ubuntu 23.10 (Mantic Minotaur), },
{ distribution: debian, codename: buster, description: Debian 10.x (Buster), },
{ distribution: debian, codename: bullseye, description: Debian 11.x (Bullseye), },
{ distribution: debian, codename: bookworm, description: Debian 12.x (Bookworm), },
{ distribution: debian, codename: trixie, description: Debian 13.x (Trixie), }
]
architecture: [
[ amd64, linux/amd64 ],
[ arm64, linux/arm64 ],
[ armhf, linux/arm/v7 ]
]
steps:
- uses: actions/checkout@v4
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.head_sha || github.event.client_payload.head_sha }}
submodules: true
submodules: recursive
- name: Generate environment variables
- name: 🔧 Prepare
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
echo '::group::Checking the version number'
if [[ "${{ inputs.nightly }}" = true ]]; then
echo "$(tr -d '\n' < .version)+nightly$(date '+%Y%m%d')$(git rev-parse --short HEAD)" > .version
else
tr -d '\n' < .version > temp && mv temp .version
fi
echo '::endgroup::'
- name: Build package
echo '::group::Generate environment variables'
VERSION=$(cat .version)
echo VERSION=${VERSION} >> $GITHUB_ENV
if [[ $VERSION == *"-"* ]]; then
echo STANDARDS_VERSION=$(echo ${VERSION%-*}) >> $GITHUB_ENV
echo DEBIAN_FORMAT='3.0 (quilt)' >> $GITHUB_ENV
else
echo STANDARDS_VERSION=$(echo ${VERSION%+*}) >> $GITHUB_ENV
echo DEBIAN_FORMAT='3.0 (native)' >> $GITHUB_ENV
fi
echo '::endgroup::'
- name: 🛠️ Setup QEMU
uses: docker/setup-qemu-action@v3
- name: 👷 Build
shell: bash
run: |
mkdir -p "${GITHUB_WORKSPACE}/deploy"
docker run --rm \
docker run --rm --platform=${{ matrix.architecture[1] }} \
-v "${GITHUB_WORKSPACE}/deploy:/deploy" \
-v "${GITHUB_WORKSPACE}:/source:rw" \
ghcr.io/hyperion-project/${{ matrix.architecture }}:${{ env.DISTRIBUTION }} \
ghcr.io/${{ env.ghcr }}/${{ matrix.os.distribution }}:${{ matrix.os.codename }} \
/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 }}' && \
dch --create --distribution ${{ matrix.os.codename }} --package 'hyperion' -v '${{ env.VERSION }}~${{ matrix.os.codename }}' '${{ 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 && \
sed 's/@ARCHITECTURE@/${{ matrix.architecture[0] }}/g; s/@STANDARDS_VERSION@/${{ env.STANDARDS_VERSION }}/g' debian/control.in > debian/control && \
debuild -b -uc -us && \
cp ../hyperion_*.deb /deploy"
- name: Upload package artifact
if: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'workflow_dispatch' }}
- name: 📦 Upload
if: ${{ inputs.publish }}
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]
name: 🚀 Publish DEB packages
# if: ${{ github.repository == 'hyperion-project' && inputs.publish }}
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout
- 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
- name: 🔑 GPG Import
if: ${{ env.SECRET_GPG_KEY != null }}
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.APT_GPG }}
gpg_private_key: ${{ secrets.GPG_KEY }}
env:
SECRET_GPG_KEY: ${{ secrets.GPG_KEY }}
- name: Install reprepro
run: sudo apt -y install reprepro
- name: 💾 Artifact download
uses: actions/download-artifact@v3
- name: Make build folders, export public GPG key and copy distributions file
- name: 🔧 Prepare
if: ${{ env.SECRET_APT_REPO_NIGHTLY != null && env.SECRET_APT_REPO != null }}
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
echo '::group::Install reprepro'
sudo apt -y install reprepro
echo '::endgroup::'
- 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"
echo '::group::Create initial structure'
mkdir -p deb/{conf,dists,db}
cp debian/distributions deb/conf/distributions
if [[ "${{ inputs.nightly }}" = true ]]; then
touch "deb/$(git rev-parse --short HEAD)"
fi
done
reprepro -Vb deb createsymlinks
reprepro -Vb deb export
echo '::endgroup::'
- name: Upload packages to APT server (DRAFT)
echo '::group::Include artifacts into the package source'
for file in artifact/hyperion_*.deb; do
if [ -f "$file" ]; then
dist=${file#*~}
dist=${dist%_*}
reprepro -Vb deb/ includedeb "$dist" "$file"
fi
done
echo '::endgroup::'
echo '::group::Set server directory'
if [[ "${{ inputs.nightly }}" = true ]]; then
echo "SERVER_DIR=${{ secrets.APT_REPO_NIGHTLY }}" >> $GITHUB_ENV
else
echo "SERVER_DIR=${{ secrets.APT_REPO }}" >> $GITHUB_ENV
fi
echo '::endgroup::'
env:
SECRET_APT_REPO_NIGHTLY: ${{ secrets.APT_REPO_NIGHTLY }}
SECRET_APT_REPO: ${{ secrets.APT_REPO }}
- name: 📦 Upload
if: ${{ env.SECRET_REPO_USER != null && env.SECRET_REPO_PASSWORD != null && env.SERVER_DIR != null }}
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 }}
server: releases.hyperion-project.org
username: ${{ secrets.REPO_USER }}
password: ${{ secrets.REPO_PASSWORD }}
server-dir: ${{ env.SERVER_DIR }}
local-dir: "./deb/"
dangerous-clean-slate: true
env:
SECRET_REPO_USER: ${{ secrets.REPO_USER }}
SECRET_REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}
- name: 🧹 Cleanup
uses: geekyeggo/delete-artifact@v2
with:
name: artifact
failOnError: false

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

@@ -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

@@ -10,7 +10,7 @@ on:
jobs:
analyze:
name: Analyze
name: 📊 Analyze
runs-on: ubuntu-latest
permissions:
actions: read
@@ -23,35 +23,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 +63,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

191
.github/workflows/dnf.yml vendored Normal file
View File

@@ -0,0 +1,191 @@
name: Hyperion DNF Build
on:
# Reusable from nightly and push
workflow_call:
inputs:
head_sha:
type: string
description: The branch, tag or SHA to checkout
default: "master"
required: false
nightly:
type: boolean
description: Nightly build
default: false
required: false
publish:
type: boolean
description: Publish packages
default: false
required: false
# For running the workflow manually via GitHub Actions tab
workflow_dispatch:
inputs:
head_sha:
type: string
description: The branch, tag or SHA to checkout
default: "master"
required: false
nightly:
type: boolean
description: Nightly build
default: false
required: false
publish:
type: boolean
description: Publish packages
default: false
required: false
env:
ghcr: paulchen-panther # hyperion-project
jobs:
build:
name: 🐧 ${{ matrix.os.distribution }} ${{ matrix.os.version }} (${{ matrix.architecture[0] }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [
{ distribution: Fedora, version: 37 },
{ distribution: Fedora, version: 38 },
{ distribution: Fedora, version: 39 },
{ distribution: Fedora, version: 40 }
]
architecture: [
[ amd64, linux/amd64 ]
# [ arm64, linux/arm64 ] temporary disabled
]
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.head_sha || github.event.client_payload.head_sha }}
submodules: recursive
- name: 🔧 Prepare
run: |
echo '::group::Checking the version number'
if [[ "${{ inputs.nightly }}" = true ]]; then
echo VERSION=$(tr -d '\n' < .version)+nightly$(date '+%Y%m%d')$(git rev-parse --short HEAD | sed s/-/_/g) >> $GITHUB_ENV
else
echo VERSION=$(tr -d '\n' < .version | sed s/-/_/g) >> $GITHUB_ENV
fi
echo '::endgroup::'
- name: 🛠️ Setup QEMU
uses: docker/setup-qemu-action@v3
- name: 👷 Build
shell: bash
run: |
DISTRIBUTION=$(echo '${{ matrix.os.distribution }}' | tr '[:upper:]' '[:lower:]')
mkdir -p "${GITHUB_WORKSPACE}/deploy"
docker run --rm --platform=${{ matrix.architecture[1] }} \
-w "/root" \
-v "${GITHUB_WORKSPACE}/deploy:/deploy" \
-v "${GITHUB_WORKSPACE}:/root/hyperion.ng:rw" \
ghcr.io/${{ env.ghcr }}/${DISTRIBUTION}:${{ matrix.os.version }} \
/bin/bash -c "tar -czf rpmbuild/SOURCES/hyperion.ng.tar.gz hyperion.ng/ && \
cp -f hyperion.ng/rpmbuild/hyperion.spec.in rpmbuild/SPECS/hyperion.spec && \
rpmbuild -ba --define '_version ${{ env.VERSION }}' rpmbuild/SPECS/hyperion.spec --clean && \
cp -fv rpmbuild/RPMS/$(uname -m)/hyperion* /deploy"
env:
ACTOR: "Hyperion Project <admin@hyperion-project.org>"
COMMIT_MESSAGE: ${{ github.event.commits[0].message }}
- name: 📦 Upload
if: ${{ inputs.publish }}
uses: actions/upload-artifact@v3
with:
path: deploy
retention-days: 1
publish:
name: 🚀 Publish RPM packages
# if: ${{ github.repository == 'hyperion-project' && inputs.publish }}
needs: [build]
runs-on: ubuntu-latest
container:
image: fedora
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.head_sha || github.event.client_payload.head_sha }}
- name: 🔑 GPG Import
id: import_gpg
if: ${{ env.SECRET_GPG_KEY != null }}
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_KEY }}
env:
SECRET_GPG_KEY: ${{ secrets.GPG_KEY }}
- name: 💾 Artifact download
uses: actions/download-artifact@v3
- name: 🔧 Prepare
if: ${{ env.SECRET_DNF_REPO_NIGHTLY != null && env.SECRET_DNF_REPO != null }}
run: |
echo '::group::Install createrepo & rpm-sign'
dnf install createrepo rpm-sign -y
echo '::endgroup::'
echo '::group::Make folders, sign/copy packages and create metadata/manifest files'
mkdir rpm/
gpg --armor --output hyperion.pub.key --export 'admin@hyperion-project.org'
rpm --import hyperion.pub.key
channel=$([ "${{ inputs.nightly }}" = true ] && echo "Nightly" || echo "Stable")
declare -A distArray=([fc]=fedora [el]=rhel)
for file in artifact/hyperion-*.rpm; do
if [ -f "$file" ]; then
dist_ver_arch=${file##*0.}
dist_ver_arch=${dist_ver_arch%.*}
dist_ver=${dist_ver_arch%.*}
[ -z "${dist_ver:0:2}" ] && continue
rpm=rpm/${distArray[${dist_ver:0:2}]}/${dist_ver:2}/${dist_ver_arch#*.}
mkdir -p $rpm/ && cp $file $rpm/
rpm --define "_gpg_name ${{ steps.import_gpg.outputs.keyid }}" --addsign $rpm/*.rpm
rpm --checksig $rpm/*.rpm
createrepo $rpm/
gpg --yes --detach-sign --armor $rpm/repodata/repomd.xml
sed -r "s/@CHANNEL@/${channel}/g; s/@DIST@/${distArray[${dist_ver:0:2}]}/g; s/@ARCH@/${dist_ver_arch#*.}/g" ${GITHUB_WORKSPACE}/rpmbuild/hyperion.repo.in > rpm/${distArray[${dist_ver:0:2}]}/hyperion.repo
fi
done
echo '::endgroup::'
echo '::group::Set server directory'
if [[ "${{ inputs.nightly }}" = true ]]; then
echo "SERVER_DIR=${{ secrets.DNF_REPO_NIGHTLY }}" >> $GITHUB_ENV
else
echo "SERVER_DIR=${{ secrets.DNF_REPO }}" >> $GITHUB_ENV
fi
echo '::endgroup::'
env:
SECRET_DNF_REPO_NIGHTLY: ${{ secrets.DNF_REPO_NIGHTLY }}
SECRET_DNF_REPO: ${{ secrets.DNF_REPO }}
- name: 📦 Upload
if: ${{ env.SECRET_REPO_USER != null && env.SECRET_REPO_PASSWORD != null && env.SERVER_DIR != null }}
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
with:
server: releases.hyperion-project.org
username: ${{ secrets.REPO_USER }}
password: ${{ secrets.REPO_PASSWORD }}
server-dir: ${{ env.SERVER_DIR }}
local-dir: "./rpm/"
dangerous-clean-slate: true
env:
SECRET_REPO_USER: ${{ secrets.REPO_USER }}
SECRET_REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}
- name: 🧹 Cleanup
uses: geekyeggo/delete-artifact@v2
with:
name: artifact
failOnError: false

View File

@@ -1,33 +1,37 @@
name: Nightly build
name: 🌑️ Nightly builds
# Create nightly builds at the end of every day
on:
schedule:
- cron: '0 0 * * *'
repository_dispatch:
types: [hyperion_nightly_push]
schedule:
- cron: '0 0 * * *'
jobs:
update:
name: Update Submodule rpi_ws281x
if: github.repository_owner == 'hyperion-project'
###############################################
###### rpi_ws281x submodule update check ######
###############################################
update_submodule:
name: 🔁 Update Submodule rpi_ws281x (Nightly build only)
if: ${{ github.repository == 'hyperion-project' && inputs.nightly }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
submodules: recursive
- name: Update Submodule rpi_ws281x
- name: 🔁 Update Submodule rpi_ws281x
id: update
run: git submodule update --remote --recursive dependencies/external/rpi_ws281x
- name: Check git status
- name: Check git status
id: status
run: echo "status=$(git status -s)" >> $GITHUB_OUTPUT
- name: Add and commit changes
- name: ✏️ Add/Commit changes
if: ${{ steps.status.outputs.status }}
run: |
git config --local user.email "20935312+Hyperion-Bot@users.noreply.github.com"
@@ -35,153 +39,73 @@ jobs:
git config --local diff.ignoreSubmodules dirty
git commit -am "Update submodule rpi_ws281x"
- name: Push changes
if: ${{ steps.status.outputs.status }}
- name: 📦 Push changes
if: ${{ env.SECRET_BOT_TOKEN != null && steps.status.outputs.status }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.HYPERION_BOT_TOKEN }}
branch: ${{ github.ref }}
env:
SECRET_BOT_TOKEN: ${{ secrets.HYPERION_BOT_TOKEN }}
##################################
###### APT/DNF commit check ######
##################################
check:
name: Compare local <-> nightly
needs: [update]
if: github.repository_owner == 'hyperion-project'
name: 🔀 Compare local <-> nightly (Nightly build only)
needs: [update_submodule]
if: ${{ github.repository == 'hyperion-project' && inputs.nightly }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check if commit has changed
id: build-necessary
- name: ⬇ Checkout
uses: actions/checkout@v3
- name: ✅ Check if commit has changed (APT)
id: apt-build-necessary
run: |
if wget --spider "https://nightly.apt.hyperion-project.org/$(git rev-parse --short HEAD)" 2>/dev/null; then
if wget --spider "https://nightly.apt.releases.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
- name: ✅ Check if commit has changed (DNF)
id: dnf-build-necessary
run: |
if wget --spider "https://nightly.dnf.releases.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 }}
build-apt-nightly: ${{ steps.apt-build-necessary.outputs.commit-has-changed }}
build-dnf-nightly: ${{ steps.dnf-build-necessary.outputs.commit-has-changed }}
setup:
name: Setup nightly build
###################################
###### APT reusable workflow ######
###################################
apt_build:
name: 👷 APT 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
if: ${{ needs.check.outputs.build-apt-nightly == 'true' }}
uses: ./.github/workflows/apt.yml
secrets: inherit
with:
nightly: true
publish: true
outputs:
nightly-matrix: ${{ steps.nightly-ppa.outputs.nightly }}
###################################
###### DNF reusable workflow ######
###################################
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
dnf_build:
name: 👷 DNF Build
needs: [check]
if: ${{ needs.check.outputs.build-dnf-nightly == 'true' }}
uses: ./.github/workflows/dnf.yml
secrets: inherit
with:
nightly: true
publish: true

View File

@@ -4,6 +4,11 @@ on:
branches:
- master
# Cancel running actions when a new action on the same PR is started
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
######################
@@ -11,57 +16,63 @@ jobs:
######################
Linux:
name: ${{ matrix.dockerName }}
name: 🐧 ${{ matrix.dockerName }}
runs-on: ubuntu-latest
strategy:
matrix:
dockerImage: [ x86_64, armv6l, armv7l, aarch64 ]
include:
- dockerImage: x86_64
dockerName: Debian Buster (x86_64)
dockerName: Debian Buster (x86_64)
platform: x11
- dockerImage: armv6l
dockerName: Debian Buster (Raspberry Pi v1 & ZERO)
dockerName: Debian Buster (Raspberry Pi v1 & ZERO)
platform: rpi
- dockerImage: armv7l
dockerName: Debian Buster (Raspberry Pi 2 & 3)
dockerName: Debian Buster (Raspberry Pi 2 & 3)
platform: rpi
- dockerImage: aarch64
dockerName: Debian Buster (Generic AARCH64)
dockerName: Debian Buster (Generic AARCH64)
platform: amlogic
steps:
- name: Checkout
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
submodules: recursive
# Append PR number to .version
- name: Append PR number to version
- name: 🔧 Prepare
shell: bash
run: |
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
echo '::group::Append PR number to version'
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
echo '::endgroup::'
# Build packages
- name: Build packages
- name: 👷 Build
env:
DOCKER_IMAGE: ${{ matrix.dockerImage }}
DOCKER_TAG: buster
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 }}
echo '::group::Build packages'
./.ci/ci_build.sh
echo '::endgroup::'
# Upload artifacts
- name: Upload artifacts
echo '::group::Collecting deployable artifacts'
mkdir -p ${{ matrix.dockerImage }}
mv deploy/*.tar.gz ${{ matrix.dockerImage }}
echo '::endgroup::'
- name: 📦 Upload
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.dockerImage }}
@@ -72,42 +83,42 @@ jobs:
######################
macOS:
name: macOS
name: 🍏 macOS
runs-on: macos-latest
steps:
- name: Checkout
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
submodules: recursive
# Append PR number to .version
- name: Append PR number to version
- name: 🔧 Prepare
shell: bash
run: |
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
echo '::group::Append PR number to version'
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
echo '::endgroup::'
# Install dependencies
- name: Install dependencies
shell: bash
run: ./.ci/ci_install.sh
echo '::group::Install dependencies'
./.ci/ci_install.sh
echo '::endgroup::'
# Build packages
- name: Build packages
- name: 👷 Build
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
echo '::group::Build packages'
./.ci/ci_build.sh
echo '::endgroup::'
# Upload artifacts
- name: Upload artifacts
echo '::group::Collecting deployable artifacts'
mkdir -p macOS
mv build/*.dmg macOS
echo '::endgroup::'
- name: 📦 Upload
uses: actions/upload-artifact@v3
with:
name: macOS
@@ -118,25 +129,41 @@ jobs:
######################
windows:
name: 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
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
submodules: recursive
# Append PR number to .version
- name: Append PR number to version
- name: 🔧 Prepare
shell: bash
run: |
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
echo '::group::Append PR number to version'
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
echo '::endgroup::'
- name: Install Qt
- name: 💾 Cache/Restore
uses: actions/cache@v3
with:
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
key: ${{ runner.os }}-chocolatey
- name: 📥 Install OpenSSL, DirectX SDK, libjpeg-turbo
shell: powershell
run: |
choco install --no-progress openssl --version=1.1.1.2100 -y
choco install --no-progress directx-sdk -y
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: 📥 Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
@@ -145,48 +172,25 @@ jobs:
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
- name: 🛠️ Setup MSVC
shell: cmd
run: call "${{env.VCINSTALLDIR}}\Auxiliary\Build\vcvars64.bat"
# Build packages
- name: Build packages
- name: 👷 Build
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
echo '::group::Build packages'
./.ci/ci_build.sh
echo '::endgroup::'
# Upload artifacts
- name: Upload artifacts
echo '::group::Collecting deployable artifacts'
mkdir -p windows
mv build/*.exe windows
echo '::endgroup::'
- name: 📦 Upload
uses: actions/upload-artifact@v3
with:
name: 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

208
.github/workflows/push.yml vendored Normal file
View File

@@ -0,0 +1,208 @@
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:
# - name: ⬇ Checkout
# uses: actions/checkout@v4
# with:
# submodules: recursive
# - name: 👷 Build
# env:
# DOCKER_IMAGE: ${{ matrix.dockerImage }}
# DOCKER_TAG: buster
# DOCKER_NAME: ${{ matrix.dockerName }}
# PLATFORM: ${{ matrix.platform }}
# shell: bash
# run: ./.ci/ci_build.sh
# - name: 📦 Upload
# 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:
# - name: ⬇ Checkout
# uses: actions/checkout@v4
# with:
# submodules: recursive
# - name: 🔧 Prepare
# shell: bash
# run: |
# echo '::group::Install dependencies'
# ./.ci/ci_install.sh
# echo '::endgroup::'
# - name: 👷 Build
# env:
# PLATFORM: osx
# shell: bash
# run: ./.ci/ci_build.sh
# - name: 📦 Upload
# 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: 💾 Cache/Restore
# uses: actions/cache@v3
# with:
# path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
# key: ${{ runner.os }}-chocolatey
# - name: 📥 Install OpenSSL, DirectX SDK, libjpeg-turbo
# shell: powershell
# run: |
# choco install --no-progress openssl --version=1.1.1.2100 -y
# choco install --no-progress directx-sdk -y
# 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: 📥 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: 🛠️ Setup
# shell: cmd
# run: call "${{env.VCINSTALLDIR}}\Auxiliary\Build\vcvars64.bat"
# - name: 👷 Build
# env:
# PLATFORM: windows
# shell: bash
# run: |
# echo '::group::Build packages'
# ./.ci/ci_build.sh
# echo '::endgroup::'
# - name: 📦 Upload
# 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
# - 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 }}
###################################
###### APT reusable workflow ######
###################################
apt_build:
name: APT Build
# if: startsWith(github.event.ref, 'refs/tags')
# needs: [Linux, macOS, windows]
uses: ./.github/workflows/apt.yml
secrets: inherit
with:
nightly: false
publish: true
###################################
###### DNF reusable workflow ######
###################################
dnf_build:
name: DNF Build
# if: startsWith(github.event.ref, 'refs/tags')
# needs: [Linux, macOS, windows]
uses: ./.github/workflows/dnf.yml
secrets: inherit
with:
nightly: false
publish: true

View File

@@ -1,18 +1,48 @@
name: Release Actions
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:
repository: hyperion-project/HyperBian
token: ${{ secrets.HYPERION_BOT_TOKEN }}
event-type: hyperion_push
# TODO FOR APT/DNF:
# dnf_release:
# name: Release DNF repository
# runs-on: ubuntu-latest
# steps:
# - name: Create Backup and Release draft files on DNF repository
# run: |
# sudo apt-get install -y ncftp
# mkdir backup draft_folder
# ncftpget -R -T -V -u ${{ secrets.YUM_USER }} -p ${{ secrets.YUM_PASSWORD }} yum.hyperion-project.org ./backup/ ./
# cd backup/ && mv ${{ secrets.DRAFT_FOLDER }}* ../draft_folder/ && rm -f backup.tar.gz
# tar -zcf ../backup.tar.gz .
# find -maxdepth 1 $(printf "! -name %s " ${{ secrets.EXCLUDED_FTP_FILES }})
# find -maxdepth 1 $(printf "! -name %s " ${{ secrets.EXCLUDED_FTP_FILES }}) -exec rm -rf {} \;
# mv ../draft_folder/* . && mv ../backup.tar.gz .
# - name: Update DNF Package Repository (Release)
# uses: SamKirkland/FTP-Deploy-Action@4.3.3
# with:
# server: yum.hyperion-project.org
# username: ${{ secrets.YUM_USER }}
# password: ${{ secrets.YUM_PASSWORD }}
# local-dir: "./backup/"
# server-dir: ./
# dangerous-clean-slate: true