From 629c5e19819467de4486b2d8ec4f6aa959c4454e Mon Sep 17 00:00:00 2001 From: s3rj1k Date: Wed, 21 Feb 2024 23:34:40 +0100 Subject: [PATCH] Add support for passing .netrc file into Docker DEB builder. --- .github/workflows/ci-deb-packages-v2.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-deb-packages-v2.yml b/.github/workflows/ci-deb-packages-v2.yml index 1cab8282..5a6b70fe 100644 --- a/.github/workflows/ci-deb-packages-v2.yml +++ b/.github/workflows/ci-deb-packages-v2.yml @@ -73,6 +73,11 @@ on: type: string default: '/usr' description: Set CMAKE_INSTALL_PREFIX variable + NETRC: + required: false + type: string + default: '' + description: Content of .netrc file for Docker build image. # outputs: # ARTIFACT_NAME: # value: deb-${{env.IMAGE_TAG}}-${{env.PLATFORM}}-artifact @@ -190,10 +195,23 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3 + - name: Create .netrc file + shell: sh + run: | + echo "${{ github.event.inputs.fileContent }}" > /tmp/$GITHUB_RUN_ID/.netrc + - name: Build debs in Docker shell: sh 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 \ + -v /tmp/${GITHUB_RUN_ID}/.netrc:/root/.netrc:ro \ + ${{ inputs.BASE_IMAGE }}:${{ inputs.DISTRO_CODENAME }} - name: Set custom variables shell: sh