1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
#!/bin/sh
set -e
ARCH=$(dpkg --print-architecture)
COMMIT_SHORT=$(echo "${GITHUB_SHA}" | cut -c-7)
export DEBFULLNAME="The Savonet Team"
export DEBEMAIL="savonet-users@lists.sourceforge.net"
export LIQUIDSOAP_BUILD_TARGET=posix
cd /tmp/liquidsoap-full/liquidsoap
eval "$(opam config env)"
OCAMLPATH="$(cat ../.ocamlpath)"
export OCAMLPATH
LIQ_VERSION=$(opam show -f version ./opam/liquidsoap.opam | cut -d'-' -f 1)
LIQ_TAG=$(echo "${DOCKER_TAG}" | sed -e 's#_#-#g')
if [ -n "${IS_ROLLING_RELEASE}" ]; then
LIQ_PACKAGE="liquidsoap-${COMMIT_SHORT}"
elif [ -n "${IS_RELEASE}" ]; then
LIQ_PACKAGE="liquidsoap"
else
TAG=$(echo "${BRANCH}" | tr '[:upper:]' '[:lower:]' | sed -e 's#[^0-9^a-z^A-Z^.^-]#-#g')
LIQ_PACKAGE="liquidsoap-${TAG}"
fi
echo "::group:: build ${LIQ_PACKAGE}.."
cp -R .github/debian .
rm -rf debian/changelog
cp -f debian/control.in debian/control
sed -e "s#@LIQ_PACKAGE@#${LIQ_PACKAGE}#g" -i debian/control
dch --create --distribution unstable --package "${LIQ_PACKAGE}" --newversion "1:${LIQ_VERSION}-${LIQ_TAG}-${DEB_RELEASE}" "Build ${COMMIT_SHORT}"
fakeroot debian/rules binary
echo "::endgroup::"
if [ "${PLATFORM}" = "amd64" ]; then
echo "::group:: save build config for ${LIQ_PACKAGE}.."
./liquidsoap --build-config > "${LIQ_TMP_DIR}/${LIQ_PACKAGE}_${LIQ_VERSION}-${LIQ_TAG}-${DEB_RELEASE}.config"
mv /tmp/liquidsoap-full/*.deb "${LIQ_TMP_DIR}"
fi
echo "::endgroup::"
echo "::group:: build ${LIQ_PACKAGE}-minimal.."
# shellcheck disable=SC2086
opam remove -y --verbose --assume-depexts $MINIMAL_EXCLUDE_DEPS
cd /tmp/liquidsoap-full
make clean
cp PACKAGES.minimal-build PACKAGES
rm .ocamlpath
cd liquidsoap
./.github/scripts/build-posix.sh 1
OCAMLPATH="$(cat ../.ocamlpath)"
export OCAMLPATH
rm -rf debian
cp -R .github/debian .
rm -rf debian/changelog
cp -f debian/control.in debian/control
sed -e "s#@LIQ_PACKAGE@#${LIQ_PACKAGE}-minimal#g" -i debian/control
cp -R debian/rules-minimal debian/rules
dch --create --distribution unstable --package "${LIQ_PACKAGE}-minimal" --newversion "1:${LIQ_VERSION}-${LIQ_TAG}-${DEB_RELEASE}" "Build ${COMMIT_SHORT}"
fakeroot debian/rules binary
echo "::endgroup::"
if [ "${PLATFORM}" = "amd64" ]; then
echo "::group:: save build config for ${LIQ_PACKAGE}.."
./liquidsoap --build-config > "${LIQ_TMP_DIR}/${LIQ_PACKAGE}-minimal_${LIQ_VERSION}-${LIQ_TAG}-${DEB_RELEASE}.config"
echo "::endgroup::"
fi
mv /tmp/liquidsoap-full/*.deb "${LIQ_TMP_DIR}"
{
echo "basename=${LIQ_PACKAGE}_${LIQ_VERSION}-${LIQ_TAG}-${DEB_RELEASE}_$ARCH"
echo "basename-minimal=${LIQ_PACKAGE}-minimal_${LIQ_VERSION}-${LIQ_TAG}-${DEB_RELEASE}_$ARCH"
} >> "${GITHUB_OUTPUT}"
|