From f69b1d507e53fb3ddb4176e7c6b549c7237584da Mon Sep 17 00:00:00 2001 From: Dominic Oram Date: Thu, 4 Jan 2024 13:30:44 +0000 Subject: [PATCH] Pull dist lockfile location into variable --- .github/workflows/code.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/code.yml b/.github/workflows/code.yml index 0e429a1f..b3a89f32 100644 --- a/.github/workflows/code.yml +++ b/.github/workflows/code.yml @@ -6,6 +6,7 @@ on: env: # The target python version, which must match the Dockerfile version CONTAINER_PYTHON: "3.11" + DIST_LOCKFILE_PATH: lockfiles-${{env.CONTAINER_PYTHON}}-dist-${{ github.sha }} jobs: lint: @@ -152,7 +153,7 @@ jobs: # step and the later build-push-action, otherwise the second build-push-action # will attempt to build the image again build-args: | - PIP_OPTIONS=-r lockfiles/requirements.txt dist-${{ github.sha }}/*.whl + PIP_OPTIONS=-r ${{env.DIST_LOCKFILE_PATH}}/requirements.txt dist-${{ github.sha }}/*.whl context: artifacts/ file: ./Dockerfile target: runtime @@ -189,7 +190,7 @@ jobs: # step and the previous build-push-action, otherwise this step will # attempt to build the image again build-args: | - PIP_OPTIONS=-r lockfiles/requirements.txt dist-${{ github.sha }}/*.whl + PIP_OPTIONS=-r ${{env.DIST_LOCKFILE_PATH}}/requirements.txt dist-${{ github.sha }}/*.whl context: artifacts/ file: ./Dockerfile target: runtime @@ -210,7 +211,7 @@ jobs: - name: Fixup blank lockfiles # Github release artifacts can't be blank - run: for f in lockfiles*dist*/*; do [ -s $f ] || echo '# No requirements' >> $f; done + run: for f in ${{env.DIST_LOCKFILE_PATH}}/*; do [ -s $f ] || echo '# No requirements' >> $f; done - name: Github Release # We pin to the SHA, not the tag, for security reasons. @@ -220,7 +221,7 @@ jobs: prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }} files: | dist-${{ github.sha }}/* - lockfiles*dist*/* + ${{env.DIST_LOCKFILE_PATH}}/* generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}