Skip to content

Create artifacts

Create artifacts #23

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
name: Create artifacts
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
permissions:
contents: read
jobs:
create-linux-artifacts:
name: Create Linux artifacts
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker
uses: docker/setup-docker-action@v4
with:
daemon-config: |
{
"debug": true,
"features": {
"containerd-snapshotter": true
}
}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v6
with:
file: ./Dockerfile.artifacts
context: ./
platforms: linux/amd64,linux/arm64
load: true
tags: fediproto-sync-artifacts:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Extract compiled artifacts
shell: bash
run: |
mkdir -p ${{ github.workspace }}/artifacts;
docker run --volume "./artifacts:/artifacts" --platform "linux/amd64" --rm "fediproto-sync-artifacts:latest" /bin/bash -c "cp -r /tmp/fediproto-sync/** /artifacts";
docker run --volume "./artifacts:/artifacts" --platform "linux/arm64" --rm "fediproto-sync-artifacts:latest" /bin/bash -c "cp -r /tmp/fediproto-sync/** /artifacts";
- name: Create artifact (Linux - x64)
uses: actions/upload-artifact@v4
with:
name: "fediproto-sync_linux-amd64_${{ github.ref_type == 'tag' && github.ref_name || github.sha }}"
path: ${{ github.workspace }}/artifacts/linux_amd64/**/*
if-no-files-found: error
- name: Create artifact (Linux - arm64)
uses: actions/upload-artifact@v4
with:
name: "fediproto-sync_linux-arm64_${{ github.ref_type == 'tag' && github.ref_name || github.sha }}"
path: ${{ github.workspace }}/artifacts/linux_arm64/**/*
if-no-files-found: error