Skip to content

Commit

Permalink
fix: Improve release to handle primary architectures
Browse files Browse the repository at this point in the history
- Switch to matrix
- Cover arm and amd builds
  • Loading branch information
kaynetik committed Oct 8, 2024
1 parent 7b84abe commit ef68574
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 14 deletions.
9 changes: 0 additions & 9 deletions .build/docker/docker-entrypoint.sh

This file was deleted.

44 changes: 39 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,19 @@ env:

jobs:
build-and-push:
name: 🐳 Build and Push Docker Image
name: 🐳 Build and Push Docker Images
runs-on: ubuntu-latest
strategy:
matrix:
target_arch:
- bun-linux-x64-modern
- bun-linux-arm64
include:
- target_arch: bun-linux-x64-modern
platform: linux/amd64
- target_arch: bun-linux-arm64
platform: linux/arm64

steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
Expand All @@ -26,10 +37,19 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=edge,branch=main
labels: |
org.opencontainers.image.title=${{ env.IMAGE_NAME }}
org.opencontainers.image.description=Data Proxy Service for Seda Protocol
org.opencontainers.image.version=${{ steps.meta.outputs.version }}
org.opencontainers.image.architecture=${{ matrix.target_arch }}
org.opencontainers.image.source=${{ github.repository }}
org.opencontainers.image.url=https://github.com/${{ github.repository }}
org.opencontainers.image.created=${{ steps.meta.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: 🛠️ Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -41,21 +61,26 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: 🏗️ Build and push Docker image
- name: 🏗️ Build and push Docker image for ${{ matrix.target_arch }}
uses: docker/build-push-action@v5
with:
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

create-release:
name: 📦 Create GitHub Release
needs: build-and-push
runs-on: ubuntu-latest

steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
Expand All @@ -76,5 +101,14 @@ jobs:
with:
allowUpdates: true
generateReleaseNotes: true
body: ${{ steps.changelog.outputs.changelog }}
tag: ${{ github.ref_name }}
name: ${{ github.ref_name }}
body: |
${{ steps.changelog.outputs.changelog }}
## Docker Images
The following Docker images were built and published to GHCR:
- [ghcr.io/sedaprotocol/seda-data-proxy:${{ github.ref_name }}-bun-linux-x64-modern](https://ghcr.io/sedaprotocol/seda-data-proxy:${{ github.ref_name }}-bun-linux-x64-modern)
- [ghcr.io/sedaprotocol/seda-data-proxy:${{ github.ref_name }}-bun-linux-arm64](https://ghcr.io/sedaprotocol/seda-data-proxy:${{ github.ref_name }}-bun-linux-arm64)
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit ef68574

Please sign in to comment.