Skip to content

chore: ignore tools in codecov (#3055) #4

chore: ignore tools in codecov (#3055)

chore: ignore tools in codecov (#3055) #4

Workflow file for this run

name: Apps release
on:
push:
tags:
- "**/v*.*.*" # Matches tags like apps/evm/single/v0.2.0, apps/testapp/v0.4.0, etc.
workflow_dispatch:
inputs:
tag:
description: "Tag to release (e.g., apps/evm/single/v0.2.0, apps/testapp/v0.4.0) - Must match Go tag."
required: true
type: string
permissions: {}
jobs:
parse-tag:
name: Parse Release Tag
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
app-path: ${{ steps.parse.outputs.app-path }}
version: ${{ steps.parse.outputs.version }}
image-name: ${{ steps.parse.outputs.image-name }}
dockerfile: ${{ steps.parse.outputs.dockerfile }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Parse tag and validate app
id: parse
run: |
# Use input tag for workflow_dispatch, otherwise use ref_name
if [ -n "${{ inputs.tag }}" ]; then
TAG="${{ inputs.tag }}"
else
TAG="${{ github.ref_name }}"
fi
echo "Processing tag: $TAG"
# Extract version (everything after the last /)
VERSION="${TAG##*/}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
# Extract app path (everything before the last /)
APP_PATH="${TAG%/*}"
echo "app-path=$APP_PATH" >> $GITHUB_OUTPUT
# Check if the app directory exists
if [ ! -d "$APP_PATH" ]; then
echo "::error::App directory '$APP_PATH' does not exist"
exit 1
fi
# Check if Dockerfile exists
if [ ! -f "$APP_PATH/Dockerfile" ]; then
echo "::error::Dockerfile not found in '$APP_PATH/'"
exit 1
fi
echo "dockerfile=$APP_PATH/Dockerfile" >> $GITHUB_OUTPUT
# Generate image name from app path (strip apps/ prefix, replace / with -)
IMAGE_PATH="${APP_PATH#apps/}"
IMAGE_NAME="ev-node-${IMAGE_PATH//\//-}"
echo "image-name=$IMAGE_NAME" >> $GITHUB_OUTPUT
echo "::notice::Building $IMAGE_NAME version $VERSION from $APP_PATH"
build-and-push:
name: Build and Push Docker Image
needs: parse-tag
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ${{ needs.parse-tag.outputs.dockerfile }}
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository_owner }}/${{ needs.parse-tag.outputs.image-name }}:${{ needs.parse-tag.outputs.version }}
ghcr.io/${{ github.repository_owner }}/${{ needs.parse-tag.outputs.image-name }}:latest