Skip to content

Build and Publish Client Monitor #10

Build and Publish Client Monitor

Build and Publish Client Monitor #10

Workflow file for this run

name: Build and Publish Client Monitor
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: xmtp/d14n-client-monitor
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Capture commit metadata
id: vars
run: |
echo "short_sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Read libxmtp version
id: libxmtp
run: |
echo "libxmtp_version=$(cat LIBXMTP_VERSION)" >> "$GITHUB_OUTPUT"
- name: Clone libxmtp
run: git clone https://github.com/xmtp/libxmtp.git libxmtp
- name: Checkout libxmtp version
run: |
cd libxmtp
git fetch --all --tags
git checkout ${{ steps.libxmtp.outputs.libxmtp_version }}
- name: Sync xmtp_debug sources
run: |
rm -rf libxmtp/xmtp_debug
mkdir -p libxmtp/xmtp_debug
rsync -av --delete --exclude '.git' --exclude '.github' ./ libxmtp/xmtp_debug
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ steps.vars.outputs.short_sha }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: ./libxmtp
file: ./libxmtp/xmtp_debug/docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}