From 504c2112a868c81a6b4b0c4ee50dfbfeb5000ea5 Mon Sep 17 00:00:00 2001 From: Dan Kluser Date: Thu, 14 May 2026 13:19:45 +0200 Subject: [PATCH] CI: build and release kernel on push --- .github/workflows/build-kernel.yml | 93 +++++++++++++++++++++++++++++ .github/workflows/trigger-build.yml | 19 ++++++ 2 files changed, 112 insertions(+) create mode 100644 .github/workflows/build-kernel.yml create mode 100644 .github/workflows/trigger-build.yml diff --git a/.github/workflows/build-kernel.yml b/.github/workflows/build-kernel.yml new file mode 100644 index 0000000..04b3881 --- /dev/null +++ b/.github/workflows/build-kernel.yml @@ -0,0 +1,93 @@ +name: Build Kernel +run-name: Build Kernel + +on: + workflow_dispatch: + inputs: + format: + description: 'Package format' + default: 'all' + type: choice + options: [deb, arch, all] + patches_ref: + description: 'Patches branch/tag/SHA (empty = default)' + default: '' + type: string + workflow_call: + inputs: + patches_ref: + type: string + default: '' +jobs: + build: + runs-on: self-hosted + timeout-minutes: 120 + permissions: + contents: write + + env: + CCACHE_DIR: /home/opc/ccache + + steps: + - name: Checkout image builder + uses: actions/checkout@v6 + with: + repository: ps5-linux/ps5-linux-image + path: image + ref: main + + - name: Build kernel + run: | + FORMAT="${{ inputs.format || github.event.client_payload.format || 'all' }}" + PATCHES_REF="${{ inputs.patches_ref || '' }}" + bash image/build_image.sh --kernel-only \ + --distro "$FORMAT" \ + --patches-ref "$PATCHES_REF" + + - name: Read kernel and patches version + id: version + run: | + psha=$(git -C image/work/ps5-linux-patches rev-parse --short HEAD) + kver=$(cat image/linux-bin/VERSION) + ts=$(date -u +%Y%m%d-%H%M%S) + echo "kver=$kver" >> "$GITHUB_OUTPUT" + echo "psha=$psha" >> "$GITHUB_OUTPUT" + echo "ts=$ts" >> "$GITHUB_OUTPUT" + + - name: Upload build artifacts + uses: actions/upload-artifact@v6 + with: + name: kernel-${{ steps.version.outputs.kver }}-${{ steps.version.outputs.psha }} + path: | + image/linux-bin/*.deb + image/linux-bin/*.pkg.tar.zst + retention-days: 7 + + - name: Compute checksums + id: sha + run: | + { + echo 'sums<> "$GITHUB_OUTPUT" + + - name: Create or update release + if: github.event_name != 'pull_request' && github.event_name != 'pull_request_target' + uses: softprops/action-gh-release@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + tag_name: kernel-${{ steps.version.outputs.kver }}-${{ steps.version.outputs.psha }} + name: Kernel ${{ steps.version.outputs.kver }} (${{ steps.version.outputs.psha }}) + body: | + PS5 Linux kernel packages for **${{ steps.version.outputs.kver }}**. + + Patches: [`${{ steps.version.outputs.psha }}`](https://github.com/ps5-linux/ps5-linux-patches/commit/${{ steps.version.outputs.psha }}) + + ``` + ${{ steps.sha.outputs.sums }} + ``` + files: | + image/linux-bin/*.deb + image/linux-bin/*.pkg.tar.zst + make_latest: true diff --git a/.github/workflows/trigger-build.yml b/.github/workflows/trigger-build.yml new file mode 100644 index 0000000..12775b1 --- /dev/null +++ b/.github/workflows/trigger-build.yml @@ -0,0 +1,19 @@ +name: deploy + +on: + workflow_dispatch: + push: + branches: [main] + pull_request_target: + types: [labeled] + branches: [main] + +jobs: + kernel: + if: github.event.label.name == 'run-ci' || github.event_name != 'pull_request_target' + permissions: + contents: write + uses: ./.github/workflows/build-kernel.yml + with: + patches_ref: ${{ github.event.pull_request.head.sha || github.sha }} + secrets: inherit