Skip to content

Commit db77872

Browse files
committed
build: fail if no virtual packages are created
Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
1 parent ef7c455 commit db77872

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ci/build_scripts/package.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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)