Skip to content

Commit

Permalink
fix yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferret-san committed Nov 7, 2024
1 parent 458bfbd commit 42aed1d
Show file tree
Hide file tree
Showing 2 changed files with 186 additions and 10 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ on:
push:
branches:
- main
- develop
- test/github-actions
- celestia-develop
pull_request:
branches:
- main
- develop
- celestia-develop
types: [opened, synchronize, reopened]
workflow_dispatch:

Expand Down
191 changes: 184 additions & 7 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,192 @@
name: Validate Workflows
name: Release

on:
pull_request:
paths:
- ".github/workflows/**"
workflow_dispatch:
push:
tags:
- "da-server/v*"
- "ci-builder*/v*"
- "proofs-tools/v*"
- "cannon/v*"
- "ufm-*/v*"
- "op-*/v*"

env:
REGISTRY: ghcr.io
REPO: ${{ github.repository_owner }}

jobs:
validate:
approve-release:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
environment: release-approval
steps:
- run: echo "Release approved"

docker-release-standard:
needs: [approve-release]
if: always() && (needs.approve-release.result == 'success' || needs.approve-release.result == 'skipped')
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
component:
- op-node
- op-batcher
- op-proposer
- op-challenger
- op-dispute-mon
- op-conductor
- da-server
- op-ufm
- op-supervisor
- op-deployer
- cannon
steps:
- uses: actions/checkout@v4

- name: Validate workflows
uses: docker://rhysd/actionlint:latest
- name: Generate Docker Tags
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.REPO }}/${{ matrix.component }}
tags: |
type=sha,format=short
type=ref,event=tag
type=raw,value=latest,enable={{is_default_branch}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

docker-release-amd64:
needs: [approve-release]
if: always() && (needs.approve-release.result == 'success' || needs.approve-release.result == 'skipped')
runs-on: ubuntu-latest-16-cores
permissions:
contents: read
packages: write
strategy:
matrix:
component:
- ci-builder
- ci-builder-rust
- proofs-tools
steps:
- uses: actions/checkout@v4

- name: Generate Docker Tags
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.REPO }}/${{ matrix.component }}
tags: |
type=sha,format=short
type=ref,event=tag
type=raw,value=latest,enable={{is_default_branch}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

verify-release:
needs: [docker-release-standard]
runs-on: ubuntu-latest
strategy:
matrix:
component:
[
op-node,
op-batcher,
op-proposer,
op-challenger,
op-dispute-mon,
op-conductor,
da-server,
op-ufm,
op-supervisor,
op-deployer,
cannon,
]
steps:
- name: Verify Multi-platform Support
shell: bash
run: |
IMAGE_NAME="${REGISTRY}/${REPO}/${{ matrix.component }}:sha-${GITHUB_SHA}"
echo "Verifying image: ${IMAGE_NAME}"
# Check for ARM64 support
echo "Checking ARM64 support..."
docker manifest inspect "${IMAGE_NAME}" | jq -e '.manifests[] | select(.platform.architecture == "arm64")'
# Check for AMD64 support
echo "Checking AMD64 support..."
docker manifest inspect "${IMAGE_NAME}" | jq -e '.manifests[] | select(.platform.architecture == "amd64")'
- name: Test Image
shell: bash
run: |
IMAGE_NAME="${REGISTRY}/${REPO}/${{ matrix.component }}:sha-${GITHUB_SHA}"
docker pull "${IMAGE_NAME}"
docker run --rm "${IMAGE_NAME}" "${{ matrix.component }}" --version
notify-release:
needs: [verify-release]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check workflow status
id: check
run: |
if [ "${{ needs.verify-release.result }}" = "success" ]; then
echo "status=✅ Release successful" >> "$GITHUB_OUTPUT"
else
echo "status=❌ Release failed" >> "$GITHUB_OUTPUT"
fi
- name: Create Release Summary
run: |
{
echo "### Release Status: ${{ steps.check.outputs.status }}"
echo "* Release Tag: ${{ github.ref_name }}"
} >> "$GITHUB_STEP_SUMMARY"

0 comments on commit 42aed1d

Please sign in to comment.