Skip to content

Commit

Permalink
Merge pull request #53 from devilbox/artifact-name
Browse files Browse the repository at this point in the history
Make version optional in artifact name
  • Loading branch information
cytopia authored Nov 6, 2022
2 parents 52f5c06 + 75ad5f6 commit 92d0492
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/docker-multistage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ on:
description: 'Unique artifact name prefix (to avoid overriding existing artifcats during parallel runs).'
required: true
type: string
artifact_prev_name_add_version:
description: 'Add version to artifact name to download.'
required: false
default: true
type: boolean
artifact_curr_name_add_version:
description: 'Add version to artifact name to upload.'
required: false
default: true
type: boolean
has_refs:
description: 'The ref build matrix as JSON string (list of git refs to build/deploy).'
required: true
Expand Down Expand Up @@ -88,8 +98,16 @@ jobs:
VERSION="${{ matrix.version }}"
ARCH="$( echo "${{ matrix.arch }}" | sed 's|/|-|g' )"
NAME_PREV="${{ inputs.artifact_prefix }}-${PRE_HASH}-${VERSION}-${ARCH}-${{ inputs.stage_prev }}"
NAME_CURR="${{ inputs.artifact_prefix }}-${PRE_HASH}-${VERSION}-${ARCH}-${{ inputs.stage }}"
if [ "${{ inputs.artifact_prev_name_add_version }}" = "true" ]; then
NAME_PREV="${{ inputs.artifact_prefix }}-${PRE_HASH}-${VERSION}-${ARCH}-${{ inputs.stage_prev }}"
else
NAME_PREV="${{ inputs.artifact_prefix }}-${PRE_HASH}-${ARCH}-${{ inputs.stage_prev }}"
fi
if [ "${{ inputs.artifact_curr_name_add_version }}" = "true" ]; then
NAME_CURR="${{ inputs.artifact_prefix }}-${PRE_HASH}-${VERSION}-${ARCH}-${{ inputs.stage }}"
else
NAME_CURR="${{ inputs.artifact_prefix }}-${PRE_HASH}-${ARCH}-${{ inputs.stage }}"
fi
echo "::set-output name=prev::${NAME_PREV}"
echo "::set-output name=curr::${NAME_CURR}"
Expand Down

0 comments on commit 92d0492

Please sign in to comment.