@@ -11,10 +11,13 @@ jobs:
1111 strategy :
1212 fail-fast : false
1313 matrix :
14+ os :
15+ - ubuntu-22.04
16+ - ubuntu-24.04
1417 varnish :
1518 - varnish77
1619 - varnish80
17- runs-on : ubuntu-24.04
20+ runs-on : ${{ matrix.os }}
1821 steps :
1922 - uses : actions/checkout@v4
2023
2427 - name : Cache Rust dependencies
2528 uses : Swatinem/rust-cache@v2
2629 with :
27- prefix-key : ${{ matrix.varnish }}
30+ prefix-key : ${{ matrix.os }}-${{ matrix. varnish }}
2831
2932 - name : Install Varnish from packagecloud
3033 run : |
@@ -35,11 +38,30 @@ jobs:
3538 - name : Install cargo-deb
3639 run : cargo install cargo-deb
3740
41+ - name : Set distro codename
42+ run : |
43+ if [ "${{ matrix.os }}" = "ubuntu-22.04" ]; then
44+ echo "DISTRO_CODENAME=jammy" >> $GITHUB_ENV
45+ elif [ "${{ matrix.os }}" = "ubuntu-24.04" ]; then
46+ echo "DISTRO_CODENAME=noble" >> $GITHUB_ENV
47+ else
48+ echo "Error: Unknown OS version ${{ matrix.os }}"
49+ exit 1
50+ fi
51+
3852 - name : Build Debian package
3953 run : cargo deb --variant=${{ matrix.varnish }}
4054
55+ - name : Rename package with distro codename
56+ run : |
57+ cd target/debian
58+ ORIG_FILE=$(ls vmod-lambda-${{ matrix.varnish }}_*.deb)
59+ NEW_FILE="${ORIG_FILE%.deb}_${DISTRO_CODENAME}.deb"
60+ mv "$ORIG_FILE" "$NEW_FILE"
61+ echo "DEB_FILE=$NEW_FILE" >> $GITHUB_ENV
62+
4163 - name : Upload artifact
4264 uses : actions/upload-artifact@v4
4365 with :
44- name : vmod-lambda-${{ matrix.varnish }}.deb
45- path : target/debian/*.deb
66+ name : vmod-lambda-${{ matrix.varnish }}-${DISTRO_CODENAME} .deb
67+ path : target/debian/${{ env.DEB_FILE }}
0 commit comments