From 918805d7849fca29fad56f7a9fe9d0b6c5734cdb Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Mon, 2 Feb 2026 16:46:11 +0100 Subject: [PATCH 1/2] Add PR artifact uploads and comments Update the build workflow to handle pull request runs: make the main artifact upload conditional (skip for pull_request), add a separate upload step for PR artifacts with longer retention, and post a sticky PR comment containing a download link. Also adjust workflow permissions to allow pull-request write access and include updated artifact paths. --- .github/workflows/build.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 53944d10d..40a6774c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,6 +28,8 @@ jobs: name: (${{ matrix.os_prefix }}/${{ matrix.arch }}) Create Processing Build runs-on: ${{ matrix.os }} needs: test + permissions: + pull-requests: write strategy: fail-fast: false matrix: @@ -64,7 +66,28 @@ jobs: - name: Add artifact uses: actions/upload-artifact@v4 + if: ${{ github.event_name != 'pull_request' }} with: name: processing-${{ matrix.os_prefix }}-${{ matrix.arch }}-br_${{ github.ref_name }} retention-days: 1 - path: app/build/compose/binaries/main/${{ matrix.binary }} \ No newline at end of file + path: app/build/compose/binaries/main/${{ matrix.binary }} + + - name: Add artifact for PR + if: ${{ github.event_name == 'pull_request' }} + uses: actions/upload-artifact@v4 + with: + name: processing-${{ matrix.os_prefix }}-${{ matrix.arch }}-pr_${{ github.event.pull_request.number }} + retention-days: 5 + path: app/build/compose/binaries/main/${{ matrix.binary }} + + - name: Add comment with binaries + if: ${{ github.event_name == 'pull_request' }} + uses: marocchino/sticky-pull-request-comment@v2 + with: + append: true + header: '## Build Artifacts' + message: | + ### (${{ matrix.os_prefix }}/${{ matrix.arch }}) Build Artifacts + - [Download processing-${{ matrix.os_prefix }}-${{ matrix.arch }}-pr_${{ github.event.pull_request.number }}](${{ steps.upload-artifact.outputs.download_url }}) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From f763f889d019379b386c69a860053dce80e10d12 Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Mon, 2 Feb 2026 17:45:25 +0100 Subject: [PATCH 2/2] Update build workflow: PR comments and artifacts Add PR-facing comments and artifact wiring to the CI workflow. Post a sticky comment after Gradle tests to indicate artifacts availability, add an upload-artifact step with an id, and update the sticky-comment step to use the artifact output URL (steps.upload-artifact.outputs.artifact-url) and a consistent header. These changes make build artifacts discoverable on pull requests. --- .github/workflows/build.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40a6774c3..9d4b1f8b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,6 +24,15 @@ jobs: - name: Build with Gradle run: ./gradlew test + + - name: Add comment with binaries + if: ${{ github.event_name == 'pull_request' }} + uses: marocchino/sticky-pull-request-comment@v2 + with: + append: true + header: artifacts + message: | + Tests completed successfully. Build artifacts will be available after the build job. build: name: (${{ matrix.os_prefix }}/${{ matrix.arch }}) Create Processing Build runs-on: ${{ matrix.os }} @@ -74,6 +83,7 @@ jobs: - name: Add artifact for PR if: ${{ github.event_name == 'pull_request' }} + id: upload-artifact uses: actions/upload-artifact@v4 with: name: processing-${{ matrix.os_prefix }}-${{ matrix.arch }}-pr_${{ github.event.pull_request.number }} @@ -85,9 +95,9 @@ jobs: uses: marocchino/sticky-pull-request-comment@v2 with: append: true - header: '## Build Artifacts' + header: artifacts message: | - ### (${{ matrix.os_prefix }}/${{ matrix.arch }}) Build Artifacts - - [Download processing-${{ matrix.os_prefix }}-${{ matrix.arch }}-pr_${{ github.event.pull_request.number }}](${{ steps.upload-artifact.outputs.download_url }}) + ### (${{ matrix.os_prefix }}/${{ matrix.arch }}) + - [Download processing-${{ matrix.os_prefix }}-${{ matrix.arch }}-pr_${{ github.event.pull_request.number }}](${{ steps.upload-artifact.outputs.artifact-url }}) env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}