Skip to content

Commit a100c21

Browse files
[PATCH] review and improve build GHA workflow (- WIP #265 -)
* this work is realted to the GHA #265 Changes in file .github/workflows/CI-BUILD.yml: * testing out build artifacts in prep for GHA #338 * reviewed for GHA #265 Changes in file tests/check_cc_lines: * related work
1 parent da65147 commit a100c21

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

.github/workflows/CI-BUILD.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
statuses: write
3434
packages: none
3535
pull-requests: read
36+
id-token: write
37+
attestations: write
3638
security-events: none
3739
if: ${{ !cancelled() && (github.repository == 'reactive-firewall/multicast') }}
3840
runs-on: ubuntu-latest
@@ -42,6 +44,7 @@ jobs:
4244
shell: bash
4345
env:
4446
LANG: "en_US.UTF-8"
47+
GIT_MATCH_PATTERN: "dist/multicast-*-*.whl dist/multicast-*.tar.gz"
4548
outputs:
4649
build_status: ${{ steps.build.outcome }}
4750
steps:
@@ -64,9 +67,34 @@ jobs:
6467
- name: Test Build
6568
id: build
6669
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 }}
7098

7199
BOOTSTRAP:
72100
permissions:
@@ -182,3 +210,9 @@ jobs:
182210
fi
183211
echo "build_ref=${{ github.ref }}" >> "$GITHUB_OUTPUT"
184212
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

tests/check_cc_lines

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ for _TEST_DOC in $FILES_TO_CHECK ; do
154154
python3 -B .github/tools/cioutput.py -l info --file "${_TEST_DOC}" --title "COPYRIGHT" "SKIP: ${_TEST_DOC} is missing a valid copyright line begining with \"Copyright (c)\"" ;
155155
fi
156156
if [[ ( $(grep -F "Copyright (c)" "${_TEST_DOC}" 2>&1 | grep -oE "\d+(-\d+)?" 2>&1 | grep -oE "\d{3,}$" | sort -n | tail -n1) -lt "${_TEST_YEAR}") ]] ; then
157-
python3 -B .github/tools/cioutput.py -l info --file "${_TEST_DOC}" --title "DATE" "WARN: ${_TEST_DOC} is out of date without a current copyright (year)" >&2 ;
157+
python3 -B .github/tools/cioutput.py -l warning --file "${_TEST_DOC}" --title "DATE" "WARN: ${_TEST_DOC} is out of date without a current copyright (year)" >&2 ;
158158
fi
159159
# shellcheck disable=SC2086
160160
if [[ ( ${EXIT_CODE} -ne 0 ) ]] ; then

0 commit comments

Comments
 (0)