mirror of
https://github.com/processing/processing4.git
synced 2026-04-28 23:21:08 +02:00
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`
This commit is contained in:
39
.github/workflows/build.yml
vendored
39
.github/workflows/build.yml
vendored
@@ -24,10 +24,26 @@ 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:
|
||||
header: artifacts
|
||||
GITHUB_TOKEN: ${{ secrets.PR_PAT }}
|
||||
message: |
|
||||
Tests completed successfully. Build artifacts for this pull request will appear below once ready.
|
||||
|
||||
### Build Artifacts
|
||||
| Platform | Link |
|
||||
|:--|------------------------|
|
||||
|
||||
build:
|
||||
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 +80,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 }}
|
||||
path: app/build/compose/binaries/main/${{ matrix.binary }}
|
||||
|
||||
- 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 }}
|
||||
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: artifacts
|
||||
GITHUB_TOKEN: ${{ secrets.PR_PAT }}
|
||||
message: |
|
||||
|(${{ matrix.os_prefix }}/${{ matrix.arch }})|[Download processing-${{ matrix.os_prefix }}-${{ matrix.arch }}-pr_${{ github.event.pull_request.number }}](${{ steps.upload-artifact.outputs.artifact-url }})|
|
||||
|
||||
|
||||
Reference in New Issue
Block a user