diff --git a/.github/workflows/ci-deb-packages-v2.yml b/.github/workflows/ci-deb-packages-v2.yml index 49b2e923..2cc86bee 100644 --- a/.github/workflows/ci-deb-packages-v2.yml +++ b/.github/workflows/ci-deb-packages-v2.yml @@ -33,6 +33,21 @@ on: description: Default OS/Arch default: linux/amd64 type: string + INSTALL_DEPENDENCIES: + required: false + type: boolean + default: false + description: Install build dependencies from `debian/control` + DEB_BUILD_OPTIONS: + required: false + type: string + default: '' + description: Set DEB_BUILD_OPTIONS variable + VERSION_OVERRIDE: + required: false + type: string + default: '' + description: Override Version variable from `dpkg-parsechangelog --show-field Version` USE_CMAKE: required: false type: boolean @@ -66,6 +81,10 @@ jobs: - name: Generate DEBs based on ${{ inputs.BASE_IMAGE }}:${{ inputs.DISTRO_CODENAME }} for ${{ inputs.PLATFORM }} if: ${{ inputs.USE_CMAKE == false }} shell: sh + env: + INSTALL_DEPENDENCIES: ${{ inputs.INSTALL_DEPENDENCIES }} + DEB_BUILD_OPTIONS_CONFIG: ${{ inputs.DEB_BUILD_OPTIONS }} + VERSION_OVERRIDE: ${{ inputs.VERSION_OVERRIDE }} run: | mkdir -v -p /tmp/$GITHUB_RUN_ID/ @@ -83,6 +102,11 @@ jobs: exit 1 fi + if [ -n "${VERSION_OVERRIDE}" ]; then + version=${VERSION_OVERRIDE} + echo "Overriding Version value to: \${version}" + fi + lsb=\$(lsb_release -cs) if [ $? -ne 0 ]; then exit 1 @@ -91,6 +115,12 @@ jobs: # eval inside runner hash=$(echo $GITHUB_SHA | cut -c1-10) + if [ "${INSTALL_DEPENDENCIES}" = "true" ]; then + apt-get -q update && \ + mk-build-deps --install --remove debian/control --tool "apt-get -y --no-install-recommends" && \ + apt-get -y -f install + fi + # deb package version dch_version=\${version}-${GITHUB_RUN_ID}-\${hash}~\${lsb} echo "dch_version: \${dch_version}" @@ -100,6 +130,12 @@ jobs: exit 1 fi + if [ -n "${DEB_BUILD_OPTIONS_CONFIG}" ]; then + export DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_CONFIG}" + echo "Environment value of DEB_BUILD_OPTIONS is set to:" + printenv DEB_BUILD_OPTIONS + fi + debuild -b -us -uc && mv -v ../*.deb . EOF