Skip to content

Commit

Permalink
build.yml: Use job outputs to assemble PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
abraxa committed Aug 27, 2024
1 parent 28f00cc commit c194964
Showing 1 changed file with 38 additions and 10 deletions.
48 changes: 38 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ jobs:
WGET: "wget -c --quiet --no-check-certificate"
ARTIFACT_VERSION: "NIGHTLY"

outputs:
pr-links: ${{ steps.pr_links.outputs.PR_LINKS }}

steps:
- name: Set artifact version to PR
if: (github.event_name == 'pull_request')
Expand Down Expand Up @@ -134,10 +137,11 @@ jobs:
path: pulseview/build/contrib/pulseview*installer.exe

- name: Add artifact to pull request message
id: pr_links
# Only relevant for pull requests
if: (github.event_name == 'pull_request')
run: |
echo "PR_LINKS=$PR_LINKS | pulseview-${{ env.ARTIFACT_VERSION }}-${{ matrix.target.target }}-${{ matrix.build_type.name }}-installer.exe | ${{ steps.upload.outputs.artifact-url }}" >> $GITHUB_ENV
echo "PR_LINKS=$PR_LINKS | pulseview-${{ env.ARTIFACT_VERSION }}-${{ matrix.target.target }}-${{ matrix.build_type.name }}-installer.exe | ${{ steps.upload.outputs.artifact-url }}" >> $GITHUB_OUTPUT
build_sigrok-cli_mxe:
Expand Down Expand Up @@ -165,6 +169,9 @@ jobs:
WGET: "wget -c --quiet --no-check-certificate"
ARTIFACT_VERSION: "NIGHTLY"

outputs:
pr-links: ${{ steps.pr_links.outputs.PR_LINKS }}

steps:
- name: Set artifact version to PR
if: (github.event_name == 'pull_request')
Expand Down Expand Up @@ -233,10 +240,11 @@ jobs:
path: sigrok-cli/contrib/sigrok-cli*installer.exe

- name: Add artifact to pull request message
id: pr_links
# Only relevant for pull requests
if: (github.event_name == 'pull_request')
run: |
echo "PR_LINKS=$PR_LINKS | sigrok-cli-${{ env.ARTIFACT_VERSION }}-${{ matrix.target.target }}-debug-installer.exe | ${{ steps.upload.outputs.artifact-url }}" >> $GITHUB_ENV
echo "PR_LINKS=$PR_LINKS | sigrok-cli-${{ env.ARTIFACT_VERSION }}-${{ matrix.target.target }}-debug-installer.exe | ${{ steps.upload.outputs.artifact-url }}" >> $GITHUB_OUTPUT
build_pulseview_appimage:
Expand Down Expand Up @@ -283,6 +291,9 @@ jobs:
ARTIFACT_BIN_NAME: "pulseview"
ARTIFACT_VERSION: "NIGHTLY"

outputs:
pr-links: ${{ steps.pr_links.outputs.PR_LINKS }}

steps:
- name: Set artifact version to PR
if: (github.event_name == 'pull_request')
Expand Down Expand Up @@ -359,10 +370,11 @@ jobs:
path: sigrok-build/ci/appimage/appimage-build/pulseview-*.appimage

- name: Add artifact to pull request message
id: pr_links
# Only relevant for pull requests
if: (github.event_name == 'pull_request')
run: |
echo "PR_LINKS=$PR_LINKS | pulseview-${{ matrix.target.target }}-${{ matrix.build_type.name }}-appimage | ${{ steps.upload.outputs.artifact-url }}" >> $GITHUB_ENV
echo "PR_LINKS=$PR_LINKS | pulseview-${{ matrix.target.target }}-${{ matrix.build_type.name }}-appimage | ${{ steps.upload.outputs.artifact-url }}" >> $GITHUB_OUTPUT
build_sigrok-cli_appimage:
Expand Down Expand Up @@ -405,6 +417,9 @@ jobs:
ARTIFACT_BIN_NAME: "sigrok-cli"
ARTIFACT_VERSION: "NIGHTLY"

outputs:
pr-links: ${{ steps.pr_links.outputs.PR_LINKS }}

steps:
- name: Set artifact version to PR
if: (github.event_name == 'pull_request')
Expand Down Expand Up @@ -478,10 +493,11 @@ jobs:
path: sigrok-build/ci/appimage/appimage-build/sigrok-cli-*.appimage

- name: Add artifact to pull request message
id: pr_links
# Only relevant for pull requests
if: (github.event_name == 'pull_request')
run: |
echo "PR_LINKS=$PR_LINKS | sigrok-cli-${{ env.ARTIFACT_VERSION }}-${{ matrix.target.target }}-debug.appimage | ${{ steps.upload.outputs.artifact-url }}" >> $GITHUB_ENV
echo "PR_LINKS=$PR_LINKS | sigrok-cli-${{ env.ARTIFACT_VERSION }}-${{ matrix.target.target }}-debug.appimage | ${{ steps.upload.outputs.artifact-url }}" >> $GITHUB_OUTPUT
build_pulseview_macos:
Expand Down Expand Up @@ -509,6 +525,9 @@ jobs:
ARTIFACT_BIN_NAME: "pulseview"
ARTIFACT_VERSION: "NIGHTLY"

outputs:
pr-links: ${{ steps.pr_links.outputs.PR_LINKS }}

steps:
- name: Set artifact version to PR
if: (github.event_name == 'pull_request')
Expand Down Expand Up @@ -582,10 +601,11 @@ jobs:
path: sigrok-build/ci/macos/pulseview*.dmg

- name: Add artifact to pull request message
id: pr_links
# Only relevant for pull requests
if: (github.event_name == 'pull_request')
run: |
echo "PR_LINKS=$PR_LINKS | pulseview-${{ env.ARTIFACT_VERSION }}-${{ env.TARGET }}.dmg | ${{ steps.upload.outputs.artifact-url }}" >> $GITHUB_ENV
echo "PR_LINKS=$PR_LINKS | pulseview-${{ env.ARTIFACT_VERSION }}-${{ env.TARGET }}.dmg | ${{ steps.upload.outputs.artifact-url }}" >> $GITHUB_OUTPUT
build_sigrok-cli_macos:
Expand All @@ -606,6 +626,9 @@ jobs:
ARTIFACT_BIN_NAME: "sigrok-cli"
ARTIFACT_VERSION: "NIGHTLY"

outputs:
pr-links: ${{ steps.pr_links.outputs.PR_LINKS }}

steps:
- name: Set artifact version to PR
if: (github.event_name == 'pull_request')
Expand Down Expand Up @@ -670,10 +693,11 @@ jobs:
path: sigrok-build/ci/macos/sigrok-cli*.dmg

- name: Add artifact to pull request message
id: pr_links
# Only relevant for pull requests
if: (github.event_name == 'pull_request')
run: |
echo "PR_LINKS=$PR_LINKS | sigrok-cli-${{ env.ARTIFACT_VERSION }}-${{ env.TARGET }}.dmg | ${{ steps.upload.outputs.artifact-url }}" >> $GITHUB_ENV
echo "PR_LINKS=$PR_LINKS | sigrok-cli-${{ env.ARTIFACT_VERSION }}-${{ env.TARGET }}.dmg | ${{ steps.upload.outputs.artifact-url }}" >> $GITHUB_OUTPUT
continuous_release_pulseview:
Expand Down Expand Up @@ -776,7 +800,7 @@ jobs:
runs-on: ubuntu-latest

needs:
# Keep in sync with job continuous_release_pulseview
# Keep in sync with job continuous_release_pulseview and see below, too
- build_pulseview_mxe
- build_pulseview_appimage
- build_pulseview_macos
Expand All @@ -790,7 +814,9 @@ jobs:
| Build | Link |
---------------------------------------------------
${{ env.PR_LINKS }}
${{ needs.build_pulseview_appimage.outputs.pr_links }}
${{ needs.build_pulseview_mxe.outputs.pr_links }}
${{ needs.build_pulseview_macos.outputs.pr_links }}
Note: Binaries are removed after 90 days. If necessary, re-trigger a build by commenting '/build'.
with:
Expand All @@ -811,7 +837,7 @@ jobs:
runs-on: ubuntu-latest

needs:
# Keep in sync with job continuous_release_pulseview
# Keep in sync with job continuous_release_pulseview and see below, too
- build_sigrok-cli_mxe
- build_sigrok-cli_appimage
- build_sigrok-cli_macos
Expand All @@ -825,7 +851,9 @@ jobs:
| Build | Link |
---------------------------------------------------
${{ env.PR_LINKS }}
${{ needs.build_sigrok-cli_appimage.outputs.pr_links }}
${{ needs.build_sigrok-cli_mxe.outputs.pr_links }}
${{ needs.build_sigrok-cli_macos.outputs.pr_links }}
Note: Binaries are removed after 90 days. If necessary, re-trigger a build by commenting '/build'.
with:
Expand Down

0 comments on commit c194964

Please sign in to comment.