From 31075fd7aceb3d9dfe603541a52dd165d30e82c7 Mon Sep 17 00:00:00 2001 From: Alperen Elhan Date: Fri, 28 Oct 2022 13:18:01 +0300 Subject: [PATCH] fix: prevent incorrect image generation --- .github/workflows/release-please.yml | 23 +++++++++++++---------- docker/Dockerfile | 8 ++++---- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 9139891..4ae00eb 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -44,7 +44,9 @@ jobs: release-please: outputs: - release_tag: ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} + release_major: ${{ steps.release.outputs.major }} + release_minor: ${{ steps.release.outputs.minor }} + release_patch: ${{ steps.release.outputs.patch }} release_created: ${{ steps.release.outputs.release_created }} needs: check runs-on: ubuntu-latest @@ -58,9 +60,6 @@ jobs: build-and-push: needs: release-please - strategy: - matrix: - platform: [linux/amd64, linux/arm64] runs-on: ubuntu-latest steps: - name: Checkout @@ -69,7 +68,7 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v2 - if: ${{ matrix.platform == 'linux/arm64' && needs.release-please.outputs.release_created }} + if: ${{ needs.release-please.outputs.release_created }} - name: Set up Docker Build uses: docker/setup-buildx-action@v2 @@ -94,9 +93,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-${{ matrix.platform }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ github.sha }} restore-keys: | - ${{ runner.os }}-${{ matrix.platform }}-buildx- + ${{ runner.os }}-buildx- if: ${{ needs.release-please.outputs.release_created }} - name: Build @@ -105,14 +104,18 @@ jobs: context: . file: docker/Dockerfile push: ${{ needs.release-please.outputs.release_created }} - platforms: ${{ matrix.platform }} + platforms: linux/amd64,linux/arm64 cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max tags: | ${{ secrets.DOCKERHUB_USERNAME }}/kaizoku:latest - ${{ secrets.DOCKERHUB_USERNAME }}/kaizoku:v${{ needs.release-please.outputs.release_tag }} + ${{ secrets.DOCKERHUB_USERNAME }}/kaizoku:v${{ needs.release-please.outputs.release_major }} + ${{ secrets.DOCKERHUB_USERNAME }}/kaizoku:v${{ needs.release-please.outputs.release_major }}.${{ needs.release-please.outputs.release_minor }} + ${{ secrets.DOCKERHUB_USERNAME }}/kaizoku:v${{ needs.release-please.outputs.release_major }}.${{ needs.release-please.outputs.release_minor }}.${{ needs.release-please.outputs.release_patch }} ghcr.io/${{ github.repository }}:latest - ghcr.io/${{ github.repository }}:v${{ needs.release-please.outputs.release_tag }} + ghcr.io/${{ github.repository }}:v${{ needs.release-please.outputs.release_major }} + ghcr.io/${{ github.repository }}:v${{ needs.release-please.outputs.release_major }}.${{ needs.release-please.outputs.release_minor }} + ghcr.io/${{ github.repository }}:v${{ needs.release-please.outputs.release_major }}.${{ needs.release-please.outputs.release_minor }}.${{ needs.release-please.outputs.release_patch }} if: ${{ needs.release-please.outputs.release_created }} - name: Move cache diff --git a/docker/Dockerfile b/docker/Dockerfile index fd415f3..149e69a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -55,13 +55,13 @@ WORKDIR /tmp RUN \ if [ "$(uname -m)" = "x86_64" ] ; then \ - curl -L "https://github.com/metafates/mangal/releases/download/v3.14.0/mangal_3.14.0_Linux_x86_64.tar.gz" -o mangal.tar.gz ;\ + curl -L "https://github.com/metafates/mangal/releases/download/v3.14.2/mangal_3.14.2_Linux_x86_64.tar.gz" -o mangal.tar.gz ;\ elif [ "$(uname -m)" = "armv6l" ] ; then \ - curl -L "https://github.com/metafates/mangal/releases/download/v3.14.0/mangal_3.14.0_Linux_armv6.tar.gz" -o mangal.tar.gz ;\ + curl -L "https://github.com/metafates/mangal/releases/download/v3.14.2/mangal_3.14.2_Linux_armv6.tar.gz" -o mangal.tar.gz ;\ elif [ "$(uname -m)" = "i386" ] ; then \ - curl -L "https://github.com/metafates/mangal/releases/download/v3.14.0/mangal_3.14.0_Linux_i386.tar.gz" -o mangal.tar.gz ;\ + curl -L "https://github.com/metafates/mangal/releases/download/v3.14.2/mangal_3.14.2_Linux_i386.tar.gz" -o mangal.tar.gz ;\ elif [ "$(uname -m)" = "aarch64" ] ; then \ - curl -L "https://github.com/metafates/mangal/releases/download/v3.14.0/mangal_3.14.0_Linux_arm64.tar.gz" -o mangal.tar.gz ;\ + curl -L "https://github.com/metafates/mangal/releases/download/v3.14.2/mangal_3.14.2_Linux_arm64.tar.gz" -o mangal.tar.gz ;\ fi RUN tar xf mangal.tar.gz RUN mv mangal /usr/bin/mangal