Skip to content

Commit 5af72ad

Browse files
committed
update: matrix deb build
1 parent bd8ebdc commit 5af72ad

1 file changed

Lines changed: 45 additions & 3 deletions

File tree

.github/workflows/build-deb.yaml

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,30 @@ on:
66
jobs:
77
build:
88
runs-on: ubuntu-latest
9+
env:
10+
DEB_BUILD_OPTIONS: nocheck # or whatever options you need
11+
strategy:
12+
matrix:
13+
distro: [debian-bookworm, debian-bullseye, ubuntu-24.04, ubuntu-22.04]
14+
include:
15+
- distro: debian-bookworm
16+
image: debian:bookworm
17+
os: debian
18+
version: bookworm
19+
- distro: debian-bullseye
20+
image: debian:bullseye
21+
os: debian
22+
version: bullseye
23+
- distro: ubuntu-24.04
24+
image: ubuntu:24.04
25+
os: ubuntu
26+
version: noble
27+
- distro: ubuntu-22.04
28+
image: ubuntu:22.04
29+
os: ubuntu
30+
version: jammy
31+
container:
32+
image: ${{ matrix.image }}
933
steps:
1034
- name: Checkout code
1135
uses: actions/checkout@v4
@@ -20,8 +44,26 @@ jobs:
2044
# Assuming you have debian/ directory with control files
2145
debuild -us -uc
2246
23-
- name: Upload deb artifact
47+
- name: Ensure package is present
48+
run: |
49+
echo "Files in workspace:"
50+
find *
51+
52+
- name: Collect .deb artifact
53+
run: |
54+
mkdir -p artifacts/${{ matrix.os }}/${{ matrix.version }}
55+
mv ../robotkernel-service-helper*.deb artifacts/${{ matrix.os }}/${{ matrix.version }}
56+
57+
- name: Set sanitized image name
58+
id: sanitize
59+
run: |
60+
version=$(dpkg-parsechangelog | sed -n 's/^Version: //p')
61+
echo "sanitized_image=$(echo "$version-$IMAGE" | tr '/:' '--')" >> $GITHUB_OUTPUT
62+
env:
63+
IMAGE: ${{ matrix.image }}
64+
65+
- name: Upload .deb package
2466
uses: actions/upload-artifact@v4
2567
with:
26-
name: robotkernel-service-helper-deb
27-
path: ../*.deb
68+
name: robotkernel-service-helper-${{ steps.sanitize.outputs.sanitized_image }}.deb
69+
path: artifacts/${{ matrix.os }}/${{ matrix.version }}/*.deb

0 commit comments

Comments
 (0)