Skip to content

Commit 8058514

Browse files
authored
Merge pull request #2777 from reubenmiller/ci-build-fix-build-virtual-packages
build: fix building of virtual packages
2 parents 6d79a7e + 90c4347 commit 8058514

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ci/build_scripts/package.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ fi
119119

120120
if [ -z "$PACKAGE_TYPES" ]; then
121121
case "$TARGET" in
122-
*linux*) PACKAGE_TYPES="deb,apk,rpm,tarball" ;;
122+
*linux*|all) PACKAGE_TYPES="deb,apk,rpm,tarball" ;;
123123
*apple*) PACKAGE_TYPES="tarball" ;;
124124
*) PACKAGE_TYPES="tarball" ;;
125125
esac
@@ -194,6 +194,14 @@ build_virtual_package() {
194194
if [[ "$PACKAGE_TYPES" =~ apk ]]; then
195195
env GIT_SEMVER="${APK_VERSION:-$GIT_SEMVER}" RELEASE="r0" nfpm "${COMMON_ARGS[@]}" --packager apk
196196
fi
197+
198+
# Expect to build at least 1 virtual package to prevent silent errors
199+
# when no virtual packages were created
200+
VIRTUAL_PACKAGE_COUNT=$(find target/virtual-packages -type f | wc -l | xargs)
201+
if [ "$VIRTUAL_PACKAGE_COUNT" -lt 1 ]; then
202+
echo "Expected at least 1 virtual packages to have been created. got=$VIRTUAL_PACKAGE_COUNT" >&2
203+
exit 1
204+
fi
197205
}
198206

199207
get_package_arch() {

0 commit comments

Comments
 (0)