Skip to content

Let Miningcore build-libs provide libmultihash #25

Let Miningcore build-libs provide libmultihash

Let Miningcore build-libs provide libmultihash #25

name: Build Miningcore image (multi-arch)
on:
workflow_dispatch:
push:
branches: [main]
paths:
- "willitmod-dev-dgb/images/miningcore/**"
- ".github/workflows/miningcore-image.yml"
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout app store repo
uses: actions/checkout@v4
- name: Checkout upstream Miningcore source
uses: actions/checkout@v4
with:
repository: oliverw/miningcore
ref: a553f62301f44c6df80891e408b6526d1dd98692
path: _vendor/miningcore
fetch-depth: 0
- name: Ensure upstream checkout has a branch (GitVersion)
run: |
set -eux
cd _vendor/miningcore
git checkout -b axedgb-pinned
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Read image tag
id: tag
run: |
echo "tag=$(cat willitmod-dev-dgb/images/miningcore/VERSION)" >> "$GITHUB_OUTPUT"
- name: Build and push (plain progress)
env:
TAG: ${{ steps.tag.outputs.tag }}
run: |
set -euo pipefail
set -x
if ! docker buildx build \
--progress=plain \
--platform linux/amd64,linux/arm64 \
-f ./willitmod-dev-dgb/images/miningcore/Dockerfile \
-t ghcr.io/willitmod/miningcore:${TAG} \
--push \
./_vendor/miningcore 2>&1 | tee /tmp/buildx.log; then
# GitHub limits annotation size; keep this short and focused.
tail_msg="$(tail -n 80 /tmp/buildx.log | sed -e 's/%/%25/g' -e 's/\r/%0D/g' -e 's/$/%0A/g' | tr -d '\n')"
err_msg="$(grep -Ei '(^|[^a-z])error:|^ERROR:' /tmp/buildx.log | tail -n 80 | sed -e 's/%/%25/g' -e 's/\r/%0D/g' -e 's/$/%0A/g' | tr -d '\n')"
dotnet_ln="$(grep -n 'dotnet publish' /tmp/buildx.log | tail -n 1 | cut -d: -f1 || true)"
if [ -n "${dotnet_ln}" ]; then
start=$((dotnet_ln - 40)); if [ "${start}" -lt 1 ]; then start=1; fi
end=$((dotnet_ln + 120))
dotnet_ctx="$(sed -n "${start},${end}p" /tmp/buildx.log | tail -n 120)"
else
dotnet_ctx=""
fi
dotnet_ctx="$(printf '%s' "${dotnet_ctx}" | sed -e 's/%/%25/g' -e 's/\r/%0D/g' -e 's/$/%0A/g' | tr -d '\n')"
echo "::error title=buildx errors (last matches)::${err_msg}"
echo "::error title=dotnet publish context::${dotnet_ctx}"
echo "::error title=buildx tail (last 80 lines)::${tail_msg}"
exit 1
fi