From 0d045f64e9b6dbf212378b8ab5a2257412f01b2a Mon Sep 17 00:00:00 2001 From: Vitor Lima Date: Fri, 21 Jun 2024 19:58:51 -0300 Subject: [PATCH] chore: Move and rename binary in DockerHub workflow --- .github/workflows/build-dockerhub.yml | 8 +++++++- build/Dockerfile.debian | 4 ++-- dockerhub.sh | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-dockerhub.yml b/.github/workflows/build-dockerhub.yml index 554b1c2..514b94a 100644 --- a/.github/workflows/build-dockerhub.yml +++ b/.github/workflows/build-dockerhub.yml @@ -57,13 +57,18 @@ jobs: # - name: Run Tests # run: cross test --verbose --target ${{ matrix.config.target }} + - name: Move and rename binary + run: | + mkdir -p build + cp target/${{ matrix.config.target }}/release/tagoio-relay build/${{ env.FILENAME }} + # Upload artifacts if this is not a release - name: Upload artifact uses: actions/upload-artifact@v4 with: name: ${{ env.FILENAME }} retention-days: 1 - path: target/${{ matrix.config.target }}/release/tagoio-relay + path: build/${{ env.FILENAME }} push-to-dockerhub: needs: build @@ -84,6 +89,7 @@ jobs: with: path: build pattern: debian-* + merge-multiple: true - name: List files run: ls -la build diff --git a/build/Dockerfile.debian b/build/Dockerfile.debian index db8f618..9221721 100644 --- a/build/Dockerfile.debian +++ b/build/Dockerfile.debian @@ -14,9 +14,9 @@ COPY /debian-* . # Rename the correct executable based on the platform RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ - mv debian-linux-amd64 tagoio-relay; \ + mv ./debian-linux-amd64 tagoio-relay; \ elif [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ - mv debian-linux-arm64 tagoio-relay; \ + mv ./debian-linux-arm64-v8 tagoio-relay; \ else \ echo "Unsupported platform: ${TARGETPLATFORM}"; \ exit 1; \ diff --git a/dockerhub.sh b/dockerhub.sh index 57eecf9..f6cc0c3 100755 --- a/dockerhub.sh +++ b/dockerhub.sh @@ -64,7 +64,7 @@ fi # Display the tags echo "Tags to be used: $TAGS" -# Debian + cd build docker buildx build --push --build-arg TAGORELAY_VERSION=${FULL_VERSION} \ --file Dockerfile.${DISTRIBUTION} \