diff --git a/.github/workflows/ci-deb-packages-v2.yml b/.github/workflows/ci-deb-packages-v2.yml index 47e30b10..f81e5a5b 100644 --- a/.github/workflows/ci-deb-packages-v2.yml +++ b/.github/workflows/ci-deb-packages-v2.yml @@ -38,6 +38,11 @@ on: type: string default: 'echo "No custom bootstrap script was provided"' description: Custom `sh` bootstrap script + PREBUILD_SCRIPT: + required: false + type: string + default: 'echo "No custom prebuild script was provided"' + description: Custom `sh` prebuild script INSTALL_DEPENDENCIES: required: false type: boolean @@ -71,6 +76,9 @@ on: # outputs: # ARTIFACT_NAME: # value: deb-${{env.IMAGE_TAG}}-${{env.PLATFORM}}-artifact + secrets: + GENERIC_TOKEN: + required: false jobs: build: @@ -129,6 +137,8 @@ jobs: # eval inside runner hash=$(echo $GITHUB_SHA | cut -c1-10) + eval "${{ inputs.PREBUILD_SCRIPT }}" + if [ "${INSTALL_DEPENDENCIES}" = "true" ]; then apt-get -q update && \ mk-build-deps --install --remove debian/control --tool "apt-get -y --no-install-recommends" && \ @@ -172,6 +182,8 @@ jobs: # eval inside runner hash=$(echo $GITHUB_SHA | cut -c1-10) + eval "${{ inputs.PREBUILD_SCRIPT }}" + PACKAGE_RELEASE="$GITHUB_RUN_ID.\${hash}" cmake . -DCMAKE_BUILD_TYPE=${{ inputs.CMAKE_BUILD_TYPE }} -DCMAKE_INSTALL_PREFIX=${{ inputs.CMAKE_INSTALL_PREFIX }} && make package EOF @@ -181,10 +193,20 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3 - - name: build debs + - name: Build debs in Docker shell: sh + env: + GENERIC_TOKEN: ${{ secrets.GENERIC_TOKEN }} run: | - docker run --platform linux/${{ inputs.PLATFORM }} --rm --entrypoint="/usr/local/bin/run.sh" -w /root -v $(pwd):/root -v /tmp/${GITHUB_RUN_ID}/run.sh:/usr/local/bin/run.sh ${{ inputs.BASE_IMAGE }}:${{ inputs.DISTRO_CODENAME }} + docker run \ + --platform linux/${{ inputs.PLATFORM }} \ + --rm \ + --entrypoint="/usr/local/bin/run.sh" \ + -w /root \ + -v $(pwd):/root \ + -v /tmp/${GITHUB_RUN_ID}/run.sh:/usr/local/bin/run.sh:ro \ + -e GENERIC_TOKEN="${GENERIC_TOKEN}" \ + ${{ inputs.BASE_IMAGE }}:${{ inputs.DISTRO_CODENAME }} - name: Set custom variables shell: sh