diff --git a/.github/workflows/axosyslog-docker.yml b/.github/workflows/axosyslog-docker.yml index 1e8008c7c..1d0ec38c5 100644 --- a/.github/workflows/axosyslog-docker.yml +++ b/.github/workflows/axosyslog-docker.yml @@ -138,6 +138,8 @@ jobs: merge-and-push: runs-on: ubuntu-latest needs: [prepare, image-build] + outputs: + tags: ${{ steps.docker-metadata-tags.outputs.tags }} steps: - name: Download digests uses: actions/download-artifact@v4 @@ -149,13 +151,21 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Extract metadata (AxoSyslog version) for Docker - id: docker-metadata-tags - uses: docker/metadata-action@v5 - with: - images: ${{ needs.prepare.outputs.image-name }} - tags: type=match,pattern=axosyslog-([0-9].*),group=1 - sep-tags: ',' + - id: docker-metadata-tags + name: Extract metadata (AxoSyslog version) for Docker + run: | + last_full_version=$(skopeo inspect docker://ghcr.io/axoflow/axosyslog:latest | jq '.RepoTags' | sed 's/ \|"\|,//g' | grep "^[0-9]*.[0-9]*.[0-9]*$\|^[0-9]*.[0-9]*.[0-9]*-[0-9]*$" | tail -n 1) + if [[ $last_full_version == *"-"* ]]; then + last_version=$(echo $last_full_version | cut -d"-" -f1) + last_patch_level=$(echo $last_full_version | cut -d"-" -f2) + next_patch_level=$((last_patch_level + 1)) + else + last_version=$(echo $last_full_version | cut -d"-" -f1) + next_patch_level=1 + fi + next_full_version="$last_version-$next_patch_level" + TAGS="ghcr.io/axoflow/axosyslog:$last_version,ghcr.io/axoflow/axosyslog:$next_full_version,ghcr.io/axoflow/axosyslog:latest" + echo "tags=$TAGS" >> $GITHUB_OUTPUT - name: Compose Docker image tags id: tags