Skip to content

Commit 75926c8

Browse files
authored
Add PR artifact uploads and comments (#1401)
* 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. * 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. * Switch to a table * update messaging * Use `processing-bot`
1 parent f34498a commit 75926c8

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

.github/workflows/build.yml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,26 @@ jobs:
2424

2525
- name: Build with Gradle
2626
run: ./gradlew test
27+
28+
- name: Add comment with binaries
29+
if: ${{ github.event_name == 'pull_request' }}
30+
uses: marocchino/sticky-pull-request-comment@v2
31+
with:
32+
header: artifacts
33+
GITHUB_TOKEN: ${{ secrets.PR_PAT }}
34+
message: |
35+
Tests completed successfully. Build artifacts for this pull request will appear below once ready.
36+
37+
### Build Artifacts
38+
| Platform | Link |
39+
|:--|------------------------|
40+
2741
build:
2842
name: (${{ matrix.os_prefix }}/${{ matrix.arch }}) Create Processing Build
2943
runs-on: ${{ matrix.os }}
3044
needs: test
45+
permissions:
46+
pull-requests: write
3147
strategy:
3248
fail-fast: false
3349
matrix:
@@ -64,7 +80,28 @@ jobs:
6480

6581
- name: Add artifact
6682
uses: actions/upload-artifact@v4
83+
if: ${{ github.event_name != 'pull_request' }}
6784
with:
6885
name: processing-${{ matrix.os_prefix }}-${{ matrix.arch }}-br_${{ github.ref_name }}
6986
retention-days: 1
70-
path: app/build/compose/binaries/main/${{ matrix.binary }}
87+
path: app/build/compose/binaries/main/${{ matrix.binary }}
88+
89+
- name: Add artifact for PR
90+
if: ${{ github.event_name == 'pull_request' }}
91+
id: upload-artifact
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: processing-${{ matrix.os_prefix }}-${{ matrix.arch }}-pr_${{ github.event.pull_request.number }}
95+
retention-days: 5
96+
path: app/build/compose/binaries/main/${{ matrix.binary }}
97+
98+
- name: Add comment with binaries
99+
if: ${{ github.event_name == 'pull_request' }}
100+
uses: marocchino/sticky-pull-request-comment@v2
101+
with:
102+
append: true
103+
header: artifacts
104+
GITHUB_TOKEN: ${{ secrets.PR_PAT }}
105+
message: |
106+
|(${{ matrix.os_prefix }}/${{ matrix.arch }})|[Download processing-${{ matrix.os_prefix }}-${{ matrix.arch }}-pr_${{ github.event.pull_request.number }}](${{ steps.upload-artifact.outputs.artifact-url }})|
107+

0 commit comments

Comments
 (0)