Skip to content

Commit

Permalink
Merge pull request #56 from devilbox/fix-deprecation
Browse files Browse the repository at this point in the history
Fix deprecation
  • Loading branch information
cytopia authored Nov 9, 2022
2 parents 38ab9d2 + 7ef54ab commit 7076444
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 36 deletions.
26 changes: 4 additions & 22 deletions .github/workflows/docker-multistage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ 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 @@ -98,18 +88,10 @@ jobs:
VERSION="${{ matrix.version }}"
ARCH="$( echo "${{ matrix.arch }}" | sed 's|/|-|g' )"
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}"
NAME_PREV="${{ inputs.artifact_prefix }}-${PRE_HASH}-${VERSION}-${ARCH}-${{ inputs.stage_prev }}"
NAME_CURR="${{ inputs.artifact_prefix }}-${PRE_HASH}-${VERSION}-${ARCH}-${{ inputs.stage }}"
echo "prev::${NAME_PREV}" >> $GITHUB_OUTPUT
echo "curr::${NAME_CURR}" >> $GITHUB_OUTPUT
- name: "[DEBUG] Show setup"
shell: bash
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/docker-multistage-configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ jobs:
shell: bash
run: |
if [ "${{ env.ENV_USER }}" = '' ] || [ "${{ env.ENV_PASS }}" = '' ]; then
echo "::set-output name=can_login::false"
echo "can_login=false" >> $GITHUB_OUTPUT
else
echo "::set-output name=can_login::true"
echo "can_login=true" >> $GITHUB_OUTPUT
fi
env:
ENV_USER: ${{ secrets.dockerhub_username }}
Expand All @@ -130,9 +130,9 @@ jobs:
shell: bash
run: |
if [ "${{ steps.set-login.outputs.can_login }}" = "true" ] && [ "${{ inputs.can_deploy }}" = "true" ]; then
echo "::set-output name=can_push::true"
echo "can_push=true" >> $GITHUB_OUTPUT
else
echo "::set-output name=can_push::false"
echo "can_push=false" >> $GITHUB_OUTPUT
fi
###
Expand All @@ -145,9 +145,11 @@ jobs:
DEFAULT_BRANCH="$( echo '${{ inputs.refs }}' | jq -M -c -r '.DEFAULT_BRANCH' )"
BRANCHES="$( echo '${{ inputs.refs }}' | jq -M -c -r '.BRANCHES' )"
NUM_LATEST_TAGS="$( echo '${{ inputs.refs }}' | jq -M -c -r '.NUM_LATEST_TAGS' )"
echo "::set-output name=default_branch::${DEFAULT_BRANCH}"
echo "::set-output name=branches::${BRANCHES}"
echo "::set-output name=num_latest_tags::${NUM_LATEST_TAGS}"
echo "default_branch=${DEFAULT_BRANCH}" >> $GITHUB_OUTPUT
echo "branches=${BRANCHES}" >> $GITHUB_OUTPUT
echo "num_latest_tags=${NUM_LATEST_TAGS}" >> $GITHUB_OUTPUT
echo "DEFAULT_BRANCH=${DEFAULT_BRANCH}"
echo "BRANCHES=${BRANCHES}"
echo "NUM_LATEST_TAGS=${NUM_LATEST_TAGS}"
Expand Down Expand Up @@ -176,7 +178,7 @@ jobs:
run: |
PRE_DATE="$( date +"%s" )"
PRE_RAND="$( echo $RANDOM | md5sum | head -c 10 )"
echo "::set-output name=prefix::${PRE_DATE}-${PRE_RAND}"
echo "prefix=${PRE_DATE}-${PRE_RAND}" >> $GITHUB_OUTPUT
###
### Set Build and Deploy Matrix
Expand All @@ -196,9 +198,9 @@ jobs:
--argjson refs '${{ steps.set-refs.outputs.matrix }}' \
'map({name:.NAME, version:.VERSION[], flavour:.FLAVOUR[], refs:$refs[]})' <<<'${{ inputs.versions }}' \
)"
echo "::set-output name=matrix_build::${MATRIX_BUILD}"
echo "::set-output name=matrix_deploy::${MATRIX_DEPLOY}"
echo "::set-output name=has_refs::true"
echo "matrix_build=${MATRIX_BUILD}" >> $GITHUB_OUTPUT
echo "matrix_deploy=${MATRIX_DEPLOY}" >> $GITHUB_OUTPUT
echo "has_refs=true" >> $GITHUB_OUTPUT
else
MATRIX_BUILD="$( \
jq -M -c \
Expand All @@ -208,9 +210,9 @@ jobs:
jq -M -c \
'map({name:.NAME, version:.VERSION[], flavour:.FLAVOUR[]})' <<<'${{ inputs.versions }}' \
)"
echo "::set-output name=matrix_build::${MATRIX_BUILD}"
echo "::set-output name=matrix_deploy::${MATRIX_DEPLOY}"
echo "::set-output name=has_refs::false"
echo "matrix_build=${MATRIX_BUILD}" >> $GITHUB_OUTPUT
echo "matrix_deploy=${MATRIX_DEPLOY}" >> $GITHUB_OUTPUT
echo "has_refs=false" >> $GITHUB_OUTPUT
fi
# ------------------------------------------------------------
Expand Down

0 comments on commit 7076444

Please sign in to comment.