Skip to content

Commit

Permalink
ci: Tag Docker images with Meltano major and minor versions (meltano#…
Browse files Browse the repository at this point in the history
…6682)

Tag Docker images with Meltano major and minor versions

Closes meltano#6589
  • Loading branch information
WillDaSilva committed Aug 29, 2022
1 parent 0f4af80 commit 9f16f32
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,20 @@ jobs:
- name: Assemble image tags
id: assemble-tags
run: |
MELTANO_VERSION="${{ steps.get-meltano-version.outputs.release-version }}"
MELTANO_VERSION_ARRAY=(${MELTANO_VERSION//./ })
MELTANO_VERSION_MAJOR="${MELTANO_VERSION_ARRAY[0]}"
MELTANO_VERSION_MAJOR_MINOR="${MELTANO_VERSION_ARRAY[0]}.${MELTANO_VERSION_ARRAY[1]}"
MELTANO_VERSION_MAJOR_MINOR_PATCH="${MELTANO_VERSION_ARRAY[0]}.${MELTANO_VERSION_ARRAY[1]}.${MELTANO_VERSION_ARRAY[2]}"
# To save space, only publish the `latest` tag for each images to the GitHub registry
if [[ "${{ env.registry }}" != "ghcr.io" ]]; then
echo "v${{ steps.get-meltano-version.outputs.release-version }}-python${{ matrix.python-version }}" >> tags
echo "v${MELTANO_VERSION_MAJOR}-python${{ matrix.python-version }}" >> tags
echo "v${MELTANO_VERSION_MAJOR_MINOR}-python${{ matrix.python-version }}" >> tags
echo "v${MELTANO_VERSION_MAJOR_MINOR_PATCH}-python${{ matrix.python-version }}" >> tags
[[ "${{ matrix.is-default-python }}" == "true" ]] && echo "SHA-${{ github.sha }}" >> tags
[[ "${{ matrix.is-default-python }}" == "true" ]] && echo "v${{ steps.get-meltano-version.outputs.release-version }}" >> tags
[[ "${{ matrix.is-default-python }}" == "true" ]] && echo "v${MELTANO_VERSION_MAJOR}" >> tags
[[ "${{ matrix.is-default-python }}" == "true" ]] && echo "v${MELTANO_VERSION_MAJOR_MINOR}" >> tags
[[ "${{ matrix.is-default-python }}" == "true" ]] && echo "v${MELTANO_VERSION_MAJOR_MINOR_PATCH}" >> tags
fi
echo "latest-python${{ matrix.python-version }}" >> tags
[[ "${{ matrix.is-default-python }}" == "true" ]] && echo "latest" >> tags
Expand Down

0 comments on commit 9f16f32

Please sign in to comment.