From 3c58e1b428be3f7c1d093d5df97de4cfc1291cd1 Mon Sep 17 00:00:00 2001 From: kaynetik Date: Tue, 8 Oct 2024 15:39:30 +0200 Subject: [PATCH] squash v11 --- .github/workflows/release.yml | 56 ++++++++--------------------------- 1 file changed, 13 insertions(+), 43 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7fd4063..a3b1d29 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,11 +21,14 @@ jobs: target_arch: - bun-linux-x64-modern - bun-linux-arm64 + - bun-darwin-arm64 include: - target_arch: bun-linux-x64-modern platform: linux/amd64 - target_arch: bun-linux-arm64 platform: linux/arm64 + - target_arch: bun-darwin-arm64 + platform: darwin/arm64 steps: - name: 📥 Checkout code @@ -35,7 +38,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.target_arch }} + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=ref,event=tag type=semver,pattern={{version}} @@ -67,7 +70,8 @@ jobs: context: . file: .build/docker/Dockerfile push: true - tags: ${{ steps.meta.outputs.tags }} + tags: | + ${{ steps.meta.outputs.tags }}-${{ matrix.target_arch }} labels: ${{ steps.meta.outputs.labels }} build-args: | TARGET_ARCH=${{ matrix.target_arch }} @@ -75,52 +79,15 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - - name: ✨ Collect image info - run: | - echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.target_arch }}:${{ steps.meta.outputs.version }}" >> image-urls-${{ matrix.target_arch }}.txt - - - name: 📦 Upload image info as artifact - uses: actions/upload-artifact@v3 - with: - name: image-urls-${{ matrix.target_arch }} - path: image-urls-${{ matrix.target_arch }}.txt - if: ${{ always() }} - - collect-artifacts: - name: 📥 Collect Artifacts - needs: build-and-push - runs-on: ubuntu-latest - steps: - - name: 🔽 Download all artifacts - uses: actions/download-artifact@v3 - with: - path: ./artifacts/ - - - name: 📝 Combine image URLs - run: | - cat ./artifacts/image-urls-*.txt > combined-image-urls.txt - - - name: 📦 Upload combined image URLs - uses: actions/upload-artifact@v3 - with: - name: combined-image-urls - path: combined-image-urls.txt - create-release: name: 📦 Create GitHub Release - needs: collect-artifacts + needs: build-and-push runs-on: ubuntu-latest steps: - name: 📥 Checkout code uses: actions/checkout@v4 - - name: 🔽 Download combined image URLs - uses: actions/download-artifact@v3 - with: - name: combined-image-urls - path: ./artifacts/ - - name: 📝 Generate Changelog id: changelog uses: TriPSs/conventional-changelog-action@v5.3.0 @@ -141,9 +108,12 @@ jobs: echo "## Docker Images" >> release-body.md echo "The following Docker images were built and published to GHCR:" >> release-body.md echo "" >> release-body.md - while read -r line; do - echo "- [$line]($line)" >> release-body.md - done < ./artifacts/combined-image-urls.txt + TAG="${GITHUB_REF##*/}" + ARCHS=('bun-linux-x64-modern' 'bun-linux-arm64' 'bun-darwin-arm64') + for ARCH in "${ARCHS[@]}"; do + IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${TAG}-${ARCH}" + echo "- [$IMAGE]($IMAGE)" >> release-body.md + done echo "::set-output name=body::$(cat release-body.md)" - name: 🎉 Create GitHub Release