From 961de5bd71dd066d4bf9f3e2b2dfdbe365ef4d20 Mon Sep 17 00:00:00 2001 From: hywax Date: Sun, 31 Dec 2023 15:26:11 +0500 Subject: [PATCH] ci: rollback Extract Docker tags --- .github/workflows/release.yml | 36 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5988bcd..56c3a6d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,6 @@ name: Release Docker Image on: push: - branches: - - ci-settings tags: - 'v*.*.*' @@ -37,26 +35,26 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - # - name: Extract Docker tags - # id: meta - # run: | - # version_tag="${{github.ref_name}}" - # tags=($version_tag) - # if [[ "$version_tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - # # prerelease tags like `v2.0.0-alpha.1` should not be released as `latest` nor `v2` - # tags+=("latest") - # tags+=($(echo "$version_tag" | cut -d. -f1)) - # fi - # releases="" - # for tag in "${tags[@]}"; do - # releases="${releases:+$releases,}${{ secrets.DOCKERHUB_USERNAME }}/mafl:$tag,ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/mafl:$tag" - # done - # echo "releases=$releases" >> "$GITHUB_OUTPUT" - # + - name: Extract Docker tags + id: meta + run: | + version_tag="${{github.ref_name}}" + tags=($version_tag) + if [[ "$version_tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + # prerelease tags like `v2.0.0-alpha.1` should not be released as `latest` nor `v2` + tags+=("latest") + tags+=($(echo "$version_tag" | cut -d. -f1)) + fi + releases="" + for tag in "${tags[@]}"; do + releases="${releases:+$releases,}${{ secrets.DOCKERHUB_USERNAME }}/mafl:$tag,ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/mafl:$tag" + done + echo "releases=$releases" >> "$GITHUB_OUTPUT" + - name: Build and push Docker images uses: docker/build-push-action@v5 with: context: . - # push: true + push: true platforms: linux/amd64,linux/arm64,linux/arm/v7 tags: ${{ steps.meta.outputs.releases }}