diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 4ed0cd0..504cf7b 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -73,6 +73,59 @@ jobs: rm -rf "${STAGE}" done + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=raw,value=${{ github.event.release.tag_name }} + type=raw,value=latest + + - name: Build and Push Docker Image + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + push: true + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Export Docker image archives for release assets + run: | + set -euo pipefail + TAG="${{ github.event.release.tag_name }}" + + docker buildx build \ + --platform linux/amd64 \ + --output type=docker,dest="dist/ds2api_${TAG}_docker_linux_amd64.tar" \ + . + + docker buildx build \ + --platform linux/arm64 \ + --output type=docker,dest="dist/ds2api_${TAG}_docker_linux_arm64.tar" \ + . + + gzip -f "dist/ds2api_${TAG}_docker_linux_amd64.tar" + gzip -f "dist/ds2api_${TAG}_docker_linux_arm64.tar" + + - name: Generate checksums + run: | + set -euo pipefail (cd dist && sha256sum *.tar.gz *.zip > sha256sums.txt) - name: Upload Release Assets