Skip to content

Commit

Permalink
squash v11
Browse files Browse the repository at this point in the history
  • Loading branch information
kaynetik committed Oct 8, 2024
1 parent 6dd7a8f commit 3c58e1b
Showing 1 changed file with 13 additions and 43 deletions.
56 changes: 13 additions & 43 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}}
Expand Down Expand Up @@ -67,60 +70,24 @@ 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 }}
platforms: ${{ matrix.platform }}
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/[email protected]
Expand All @@ -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
Expand Down

0 comments on commit 3c58e1b

Please sign in to comment.