@@ -92,10 +92,11 @@ jobs:
9292 # Note that the package build covers html docs
9393
9494 package-arch :
95- runs-on : ubuntu-24.04
95+ runs-on : ${{ matrix.runner }}
9696 strategy :
9797 matrix :
98- image : ["debian:bullseye", "debian:bookworm", "debian:sid"]
98+ runner : ["ubuntu-24.04", "ubuntu-24.04-arm"]
99+ image : ["debian:bookworm", "debian:trixie", "debian:sid"]
99100 container :
100101 image : ${{ matrix.image }}
101102 # IPC_OWNER is needed for shmget IPC_CREAT
@@ -129,7 +130,7 @@ jobs:
129130 DEBIAN_FRONTEND : noninteractive
130131 run : |
131132 case "${{matrix.image}}" in
132- debian:sid|debian:bookworm)
133+ debian:sid|debian:bookworm|debian:trixie )
133134 exit 0
134135 ;;
135136 *)
@@ -171,12 +172,37 @@ jobs:
171172 eatmydata adduser testrunner sudo
172173 chmod 0777 $(find tests/ -type d) # make test dirs world-writable for the testrunner
173174 su -c "eatmydata ./scripts/runtests -p ./tests" testrunner
175+ - name : Gather build artifacts
176+ run : |
177+ set -e
178+ set -x
179+ ARCH=$(dpkg --print-architecture)
180+ DIST=$(echo ${{ matrix.image }} | cut -d : -f 2)
181+ OUTDIR="artifacts/${DIST}/${ARCH}"
182+ mkdir -p "$OUTDIR"
183+ cp -v $(find .. -maxdepth 1 -type f | LC_ALL=C sort) "$OUTDIR" || true
184+ (cd "$OUTDIR" && sha256sum * > SHA256SUMS.txt)
185+ echo "DIST=$DIST" >> "$GITHUB_ENV"
186+ echo "ARCH=$ARCH" >> "$GITHUB_ENV"
187+ - name : Compute artifact metadata
188+ id : meta
189+ run : |
190+ echo "dist=$(echo ${{ matrix.image }} | cut -d : -f 2)" >> $GITHUB_OUTPUT
191+ echo "arch=$(dpkg --print-architecture)" >> $GITHUB_OUTPUT
192+
193+ - name : Upload build artifacts
194+ uses : actions/upload-artifact@v4
195+ with :
196+ name : linuxcnc-${{ steps.meta.outputs.dist }}-${{ steps.meta.outputs.arch }}
197+ path : artifacts/${{ steps.meta.outputs.dist }}/${{ steps.meta.outputs.arch }}
198+ if-no-files-found : error
199+
174200
175201 package-indep :
176202 runs-on : ubuntu-24.04
177203 strategy :
178204 matrix :
179- image : ["debian:bullseye ", "debian:bookworm ", "debian:sid"]
205+ image : ["debian:bookworm ", "debian:trixie ", "debian:sid"]
180206 container :
181207 image : ${{ matrix.image }}
182208 # IPC_OWNER is needed for shmget IPC_CREAT
@@ -211,7 +237,7 @@ jobs:
211237 DEBIAN_FRONTEND : noninteractive
212238 run : |
213239 case "${{matrix.image}}" in
214- debian:sid|debian:bookworm)
240+ debian:sid|debian:bookworm|debian:trixie )
215241 exit 0
216242 ;;
217243 *)
@@ -239,11 +265,101 @@ jobs:
239265 eatmydata scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION
240266 eatmydata git diff
241267 eatmydata apt-get --yes --quiet build-dep --indep-only .
242- eatmydata debuild -us -uc --build=all
268+ eatmydata debuild -us -uc --build=source, all
243269 - name : Test install debian packages
244270 env :
245271 DEBIAN_FRONTEND : noninteractive
246272 run : |
247273 set -e
248274 set -x
249275 eatmydata apt-get --yes --quiet install ../*.deb
276+ - name : Gather build artifacts
277+ run : |
278+ set -e
279+ set -x
280+ DIST=$(echo ${{ matrix.image }} | cut -d : -f 2)
281+ ARCH=all
282+ OUTDIR="artifacts/${DIST}/${ARCH}"
283+ mkdir -p "$OUTDIR"
284+ cp -v $(find .. -maxdepth 1 -type f | LC_ALL=C sort) "$OUTDIR" || true
285+ (cd "$OUTDIR" && sha256sum * > SHA256SUMS.txt)
286+ echo "DIST=$DIST" >> "$GITHUB_ENV"
287+ echo "ARCH=$ARCH" >> "$GITHUB_ENV"
288+ - name : Compute artifact metadata
289+ id : meta
290+ run : |
291+ echo "dist=$(echo ${{ matrix.image }} | cut -d : -f 2)" >> $GITHUB_OUTPUT
292+ echo "arch=all" >> $GITHUB_OUTPUT
293+
294+ - name : Upload build artifacts
295+ uses : actions/upload-artifact@v4
296+ with :
297+ name : linuxcnc-${{ steps.meta.outputs.dist }}-${{ steps.meta.outputs.arch }}
298+ path : artifacts/${{ steps.meta.outputs.dist }}/${{ steps.meta.outputs.arch }}
299+ if-no-files-found : error
300+
301+
302+ cppcheck :
303+ runs-on : ubuntu-24.04
304+ steps :
305+ - uses : actions/checkout@v2
306+ with :
307+ submodules : true
308+ fetch-depth : 0
309+ - name : Perform Source Code checks that were successful in the past
310+ continue-on-error : true
311+ run : |
312+ set -x
313+ git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc refs/tags/*:refs/tags/*
314+ sudo apt-get -y install cppcheck shellcheck
315+ scripts/cppcheck.sh
316+ - name : Shellcheck
317+ continue-on-error : true
318+ run : |
319+ scripts/shellcheck.sh
320+
321+
322+ release :
323+ name : Release packages
324+ needs :
325+ - package-arch
326+ - package-indep
327+ if : (github.event_name == 'release' && github.event.action == 'published') || startsWith(github.ref, 'refs/tags/')
328+ permissions :
329+ contents : write
330+ runs-on : ubuntu-24.04
331+ steps :
332+ - name : Download artifacts
333+ uses : actions/download-artifact@v4
334+ with :
335+ path : release_artifacts
336+ - name : Prepare upload assets
337+ run : |
338+ set -e
339+ mkdir -p upload
340+ echo "Downloaded artifacts layout:" && find release_artifacts -maxdepth 3 -print | sed 's/^/ /'
341+ for d in release_artifacts/*; do
342+ [ -d "$d" ] || continue
343+ name=$(basename "$d")
344+ # Expect name like linuxcnc-bookworm-amd64 or linuxcnc-trixie-all
345+ dist=${name#linuxcnc-}
346+ dist=${dist%-*}
347+ arch=${name##*-}
348+ echo "Processing artifact: $name (dist=$dist arch=$arch)"
349+ # Copy built files into distro and arch specific directory
350+ mkdir "upload/${dist}-${arch}/"
351+ # sort file list for stable output
352+ for f in $(find "$d" -maxdepth 1 -type f | LC_ALL=C sort); do
353+ [ -f "$f" ] || continue
354+ cp "$f" "upload/${dist}-${arch}"
355+ done
356+ echo "Preview of SHA256SUMS.txt:" && sed -n '1,200p' "upload/${dist}-${arch}/SHA256SUMS.txt" | sed 's/^/ /'
357+ echo "Upload dir contents:" && ls -l "upload/${dist}-${arch}" | sed 's/^/ /'
358+ done
359+ - name : Create GitHub Release and upload assets
360+ uses : softprops/action-gh-release@v2
361+ with :
362+ files : |
363+ upload/*
364+ env :
365+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments