|
33 | 33 | statuses: write |
34 | 34 | packages: none |
35 | 35 | pull-requests: read |
| 36 | + id-token: write |
| 37 | + attestations: write |
36 | 38 | security-events: none |
37 | 39 | if: ${{ !cancelled() && (github.repository == 'reactive-firewall/multicast') }} |
38 | 40 | runs-on: ubuntu-latest |
|
42 | 44 | shell: bash |
43 | 45 | env: |
44 | 46 | LANG: "en_US.UTF-8" |
| 47 | + GIT_MATCH_PATTERN: "dist/multicast-*-*.whl dist/multicast-*.tar.gz" |
45 | 48 | outputs: |
46 | 49 | build_status: ${{ steps.build.outcome }} |
47 | 50 | steps: |
|
64 | 67 | - name: Test Build |
65 | 68 | id: build |
66 | 69 | run: make -j1 -f Makefile build |
67 | | - - name: Post-Clean |
68 | | - id: post |
69 | | - run: make -j1 -f Makefile purge || true |
| 70 | + - name: Get BUILD Files |
| 71 | + id: buildfiles |
| 72 | + shell: bash |
| 73 | + run: | |
| 74 | + FILES=$(git ls-files -oi --exclude-standard -- ${{ env.GIT_MATCH_PATTERN }} ) |
| 75 | + if [ -z "$FILES" ]; then |
| 76 | + printf "%s\n" "::warning file=.github/workflows/CI-BUILD.yml:: No Built files found." |
| 77 | + printf "%s\n" "files=" >> "$GITHUB_OUTPUT" |
| 78 | + else |
| 79 | + printf "%s\n" "Built files found:" |
| 80 | + printf "%s\n" "$FILES" |
| 81 | + # Replace line breaks with spaces for GitHub Action Output |
| 82 | + FILES="${FILES//$'\n'/ }" |
| 83 | + printf "%s\n" "files=$FILES" >> "$GITHUB_OUTPUT" |
| 84 | + fi |
| 85 | + if: ${{ success() }} |
| 86 | + - name: Upload build artifact |
| 87 | + id: upload |
| 88 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 89 | + with: |
| 90 | + path: ${{ steps.buildfiles.outputs.files }} |
| 91 | + name: multicast-build-${{ github.sha }}.zip |
| 92 | + - name: Generate artifact attestation |
| 93 | + if: ${{ !cancelled() && steps.buildfiles.outputs.files != '' && (github.repository == 'reactive-firewall/multicast') }} |
| 94 | + uses: actions/attest-build-provenance@v2 |
| 95 | + with: |
| 96 | + subject-name: multicast-build-${{ github.sha }}.zip |
| 97 | + subject-digest: sha256:${{ steps.upload.outputs.artifact-digest }} |
70 | 98 |
|
71 | 99 | BOOTSTRAP: |
72 | 100 | permissions: |
@@ -182,3 +210,9 @@ jobs: |
182 | 210 | fi |
183 | 211 | echo "build_ref=${{ github.ref }}" >> "$GITHUB_OUTPUT" |
184 | 212 | echo "build_ref_name=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" |
| 213 | + - name: Download All Artifacts |
| 214 | + uses: actions/download-artifact@v4 |
| 215 | + with: |
| 216 | + path: dist |
| 217 | + pattern: multicast-${{ github.sha }} |
| 218 | + - run: ls -R dist |
0 commit comments