Refine Wayland driver workflow and UI #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: RPM Artifacts | |
| "on": | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| concurrency: | |
| group: rpm-artifacts-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| metadata: | |
| name: Resolve RPM Metadata | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.meta.outputs.version }} | |
| archive_prefix: ${{ steps.meta.outputs.archive_prefix }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Resolve version | |
| id: meta | |
| run: | | |
| VERSION="$(sed -n 's/^[[:space:]]*VERSION[[:space:]]\([0-9.][0-9.]*\)$/\1/p' CMakeLists.txt | head -n1)" | |
| if [[ -z "${VERSION}" ]]; then | |
| echo "Failed to resolve project version from CMakeLists.txt." >&2 | |
| exit 1 | |
| fi | |
| echo "version=${VERSION}" >> "${GITHUB_OUTPUT}" | |
| echo "archive_prefix=ro-control-${VERSION}" >> "${GITHUB_OUTPUT}" | |
| source-archive: | |
| name: Build Source Archive | |
| runs-on: ubuntu-latest | |
| needs: metadata | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Create source archive | |
| env: | |
| ARCHIVE_PREFIX: ${{ needs.metadata.outputs.archive_prefix }} | |
| run: | | |
| git archive --format=tar.gz --prefix="${ARCHIVE_PREFIX}/" --output="${ARCHIVE_PREFIX}.tar.gz" "${GITHUB_SHA}" | |
| - name: Upload source archive | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ro-control-source-${{ needs.metadata.outputs.version }} | |
| path: | | |
| ${{ needs.metadata.outputs.archive_prefix }}.tar.gz | |
| rpm: | |
| name: Build RPM (${{ matrix.arch }}) | |
| runs-on: ${{ matrix.runs_on }} | |
| needs: [metadata, source-archive] | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch: x86_64 | |
| runs_on: ubuntu-24.04 | |
| - arch: aarch64 | |
| runs_on: ubuntu-24.04-arm | |
| container: | |
| image: fedora:43 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Download source archive | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: ro-control-source-${{ needs.metadata.outputs.version }} | |
| path: dist | |
| - name: Install RPM tooling and dependencies | |
| run: | | |
| dnf install -y \ | |
| git \ | |
| rpm-build \ | |
| cmake \ | |
| extra-cmake-modules \ | |
| gcc-c++ \ | |
| ninja-build \ | |
| qt6-qtbase-devel \ | |
| qt6-qtdeclarative-devel \ | |
| qt6-qttools-devel \ | |
| qt6-qtwayland-devel \ | |
| kf6-qqc2-desktop-style \ | |
| polkit-devel \ | |
| desktop-file-utils \ | |
| appstream | |
| - name: Build RPM artifacts | |
| env: | |
| VERSION: ${{ needs.metadata.outputs.version }} | |
| ARCHIVE_PREFIX: ${{ needs.metadata.outputs.archive_prefix }} | |
| RPM_ARCH: ${{ matrix.arch }} | |
| run: | | |
| mkdir -p ~/rpmbuild/SOURCES ~/rpmbuild/SPECS dist/rpm | |
| cp "dist/${ARCHIVE_PREFIX}.tar.gz" "${HOME}/rpmbuild/SOURCES/" | |
| cp packaging/rpm/ro-control.spec "${HOME}/rpmbuild/SPECS/ro-control.spec" | |
| FEDORA_VERSION=43 | |
| MAIN_RPM_PATTERN="ro-control-[0-9]*.${RPM_ARCH}.rpm" | |
| rpmbuild -ba "${HOME}/rpmbuild/SPECS/ro-control.spec" \ | |
| --define "_topdir ${HOME}/rpmbuild" \ | |
| --define "upstream_version ${VERSION}" \ | |
| --define "dist .fc${FEDORA_VERSION}" | |
| MAIN_RPM_FILE="$(find ~/rpmbuild/RPMS -maxdepth 2 -type f -name "${MAIN_RPM_PATTERN}" | head -n1)" | |
| if [[ -z "${MAIN_RPM_FILE}" ]]; then | |
| echo "Failed to find built ${RPM_ARCH} main RPM." >&2 | |
| exit 1 | |
| fi | |
| cp "${MAIN_RPM_FILE}" "dist/rpm/ro-control-${RPM_ARCH}.rpm" | |
| - name: Validate metadata and RPM dependency surface | |
| env: | |
| RPM_ARCH: ${{ matrix.arch }} | |
| run: | | |
| desktop-file-validate data/icons/io.github.projectroasd.rocontrol.desktop | |
| appstreamcli validate --no-net data/icons/io.github.projectroasd.rocontrol.metainfo.xml | |
| MAIN_RPM_FILE="dist/rpm/ro-control-${RPM_ARCH}.rpm" | |
| rpm -qpR "${MAIN_RPM_FILE}" | tee /tmp/ro-control.requires | |
| if grep -E 'PRIVATE_API' /tmp/ro-control.requires; then | |
| echo "Forbidden Qt private ABI dependency detected." >&2 | |
| exit 1 | |
| fi | |
| rpm -qpl "${MAIN_RPM_FILE}" | grep -Fx '/usr/bin/ro-control' | |
| - name: Upload RPM artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ro-control-${{ matrix.arch }}-rpm | |
| path: | | |
| dist/rpm/ro-control-${{ matrix.arch }}.rpm |