Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Pull dist lockfile location into variable
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicOram committed Jan 4, 2024
1 parent 5c65c00 commit f69b1d5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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 }}
Expand Down

0 comments on commit f69b1d5

Please sign in to comment.