Skip to content

Commit 728fe9e

Browse files
a-bjoaopapereiraxandroc
authored
[main] Update runner image to the latest ubuntu (#3449)
- Update image to the latest ubuntu - Use dpkg-deb -Zxz to keep backward compatibility - Improve test to check compatibility with Deb OSes - Use GHA matrix strategy to test Debian OSes Co-authored-by: João Pereira <joao.pereira@broadcom.com> Co-authored-by: Alex Rocha <alex.rocha@broadcom.com>
1 parent 314ba9c commit 728fe9e

File tree

2 files changed

+47
-19
lines changed

2 files changed

+47
-19
lines changed

.github/workflows/release-build-sign-upload.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
name: Build Linux
115115
needs:
116116
- setup
117-
runs-on: ubuntu-20.04
117+
runs-on: ubuntu-latest
118118

119119
env:
120120
VERSION_BUILD: ${{ needs.setup.outputs.version-build }}
@@ -311,7 +311,7 @@ jobs:
311311
cp ../completion/cf${VERSION_MAJOR} cf/usr/share/bash-completion/completions/cf${VERSION_MAJOR}
312312
cp $root/out/cf-cli_linux_i686 cf/usr/bin/cf${VERSION_MAJOR}
313313
ln -frs cf/usr/bin/cf${VERSION_MAJOR} cf/usr/bin/cf
314-
fakeroot dpkg --build cf cf${VERSION_MAJOR}-cli-installer_${VERSION_BUILD}_i686.deb
314+
fakeroot dpkg-deb -Zxz --build cf cf${VERSION_MAJOR}-cli-installer_${VERSION_BUILD}_i686.deb
315315
mv cf${VERSION_MAJOR}-cli-installer_${VERSION_BUILD}_i686.deb $root/packaged-deb
316316
rm -rf cf
317317
popd
@@ -336,7 +336,7 @@ jobs:
336336
cp ../completion/cf${VERSION_MAJOR} cf/usr/share/bash-completion/completions/cf${VERSION_MAJOR}
337337
cp $root/out/cf-cli_linux_x86-64 cf/usr/bin/cf${VERSION_MAJOR}
338338
ln -frs cf/usr/bin/cf${VERSION_MAJOR} cf/usr/bin/cf
339-
fakeroot dpkg --build cf cf${VERSION_MAJOR}-cli-installer_${VERSION_BUILD}_x86-64.deb
339+
fakeroot dpkg-deb -Zxz --build cf cf${VERSION_MAJOR}-cli-installer_${VERSION_BUILD}_x86-64.deb
340340
mv cf${VERSION_MAJOR}-cli-installer_${VERSION_BUILD}_x86-64.deb $root/packaged-deb
341341
popd
342342
)
@@ -360,7 +360,7 @@ jobs:
360360
cp ../completion/cf${VERSION_MAJOR} cf/usr/share/bash-completion/completions/cf${VERSION_MAJOR}
361361
cp $root/out/cf-cli_linux_arm64 cf/usr/bin/cf${VERSION_MAJOR}
362362
ln -frs cf/usr/bin/cf${VERSION_MAJOR} cf/usr/bin/cf
363-
fakeroot dpkg --build cf cf${VERSION_MAJOR}-cli-installer_${VERSION_BUILD}_arm64.deb
363+
fakeroot dpkg-deb -Zxz --build cf cf${VERSION_MAJOR}-cli-installer_${VERSION_BUILD}_arm64.deb
364364
mv cf${VERSION_MAJOR}-cli-installer_${VERSION_BUILD}_arm64.deb $root/packaged-deb
365365
popd
366366
)
@@ -910,20 +910,36 @@ jobs:
910910
needs:
911911
- setup
912912
- build-linux
913-
runs-on: ubuntu-20.04
914-
container:
915-
image: ubuntu:20.04
913+
strategy:
914+
matrix:
915+
image:
916+
- debian:11
917+
- debian:12
918+
- ubuntu:20.04
919+
- ubuntu:22.04
920+
- ubuntu
921+
runs-on: ubuntu-latest
916922
steps:
917923

918924
- name: Download Signed Linux Packages
919925
uses: actions/download-artifact@v4
920926
with:
921927
name: cf-cli-linux-deb-packages
922928

923-
- name: Display structure of downloaded files
929+
- name: Display structure and verify
930+
env:
931+
IMAGE: ${{ matrix.image }}
924932
run: |
925-
ls -R
933+
docker run \
934+
--interactive \
935+
--rm \
936+
-v .:/workspace \
937+
${IMAGE} <<EOC
938+
printf "${IMAGE} -> "
939+
grep PRETTY_NAME /etc/os-release | cut -d= -f2-
940+
cd workspace
926941
ls *.deb | xargs -n1 dpkg --info
942+
EOC
927943
928944
test-macos:
929945
name: Test macOS Artifacts
@@ -1074,4 +1090,4 @@ jobs:
10741090
10751091
git push
10761092
fi
1077-
popd
1093+
popd

.github/workflows/release-update-repos.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ jobs:
233233
234234
update-deb:
235235
name: Update Debian Repository
236-
runs-on: ubuntu-20.04
236+
runs-on: ubuntu-latest
237237
needs: setup
238238
env:
239239
CLAW_URL: ${{ needs.setup.outputs.claw-url }}
@@ -307,8 +307,13 @@ jobs:
307307
name: Test Debian Repository
308308
strategy:
309309
matrix:
310-
os: [ubuntu-22.04, ubuntu-latest]
311-
runs-on: ${{ matrix.os }}
310+
image:
311+
- debian:11
312+
- debian:12
313+
- ubuntu:20.04
314+
- ubuntu:22.04
315+
- ubuntu
316+
runs-on: ubuntu-latest
312317
needs:
313318
- setup
314319
- update-deb
@@ -319,17 +324,23 @@ jobs:
319324
steps:
320325

321326
- name: Install CF CLI via apt
327+
env:
328+
IMAGE: ${{ matrix.image }}
322329
run: |
330+
docker run \
331+
--interactive \
332+
--rm \
333+
${IMAGE} <<EOC
323334
set -o pipefail -e
324335
325-
sudo apt update
326-
sudo apt install -y wget gnupg
336+
apt update
337+
apt install -y wget gnupg
327338
328-
wget -q -O - ${CLAW_URL}/debian/cli.cloudfoundry.org.key | sudo apt-key add -
329-
echo "deb ${CLAW_URL}/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
339+
wget -q -O - ${CLAW_URL}/debian/cli.cloudfoundry.org.key | apt-key add -
340+
echo "deb ${CLAW_URL}/debian stable main" | tee /etc/apt/sources.list.d/cloudfoundry-cli.list
330341
331-
sudo apt update
332-
sudo apt install -y cf${VERSION_MAJOR}-cli
342+
apt update
343+
apt install -y cf${VERSION_MAJOR}-cli
333344
334345
which cf
335346
@@ -339,6 +350,7 @@ jobs:
339350
cf${VERSION_MAJOR} -v
340351
341352
cf -v | grep "${VERSION_BUILD}"
353+
EOC
342354
343355
update-rpm:
344356
name: Update RPM Repository

0 commit comments

Comments
 (0)