-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,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] | ||
|
@@ -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 | ||
|