130 lines
5 KiB
YAML
130 lines
5 KiB
YAML
name: Build Runner Images
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- "docker/debian.Dockerfile"
|
|
- ".forgejo/workflows/build.yml"
|
|
# TODO weekly?
|
|
#schedule:
|
|
# - cron: "0 23 * * *" # Run daily at 4am UTC
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ forgejo.workflow }}-${{ forgejo.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
REGISTRY: ${{ forgejo.server_url }}
|
|
IMAGE_NAME: service/orinoco-runner
|
|
|
|
jobs:
|
|
prepare:
|
|
name: Prepare Build
|
|
runs-on: docker
|
|
outputs:
|
|
debian-oldstable-tag: ${{ steps.debian.outputs.previous-tag }}
|
|
debian-oldstable: ${{ steps.debian.outputs.previous-version }}
|
|
debian-oldstable-python: ${{ steps.debian.outputs.previous-python }}
|
|
debian-oldstable-codename: ${{ steps.debian.outputs.previous-codename }}
|
|
debian-stable-tag: ${{ steps.debian.outputs.latest-tag }}
|
|
debian-stable: ${{ steps.debian.outputs.latest-version }}
|
|
debian-stable-python: ${{ steps.debian.outputs.latest-python }}
|
|
debian-stable-codename: ${{ steps.debian.outputs.latest-codename }}
|
|
debian-sid-tag: ${{ steps.debian.outputs.unstable-tag }}
|
|
debian-sid: ${{ steps.debian.outputs.unstable-version }}
|
|
debian-sid-python: ${{ steps.debian.outputs.unstable-python }}
|
|
debian-sid-codename: ${{ steps.debian.outputs.unstable-codename }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install docker
|
|
run: |
|
|
apt-get update && apt-get install -y docker.io
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
driver: ${{ env.BUILDKIT_ENDPOINT != '' && 'remote' || 'docker-container' }}
|
|
endpoint: ${{ env.BUILDKIT_ENDPOINT || '' }}
|
|
|
|
- name: Prepare Debian builds
|
|
id: debian
|
|
uses: ./.forgejo/actions/prepare-build-inputs
|
|
with:
|
|
os-name: debian
|
|
previous-tag: oldstable
|
|
latest-tag: stable
|
|
unstable-tag: sid
|
|
|
|
|
|
build-debian:
|
|
name:
|
|
Build Debian ${{ matrix.variant == 'oldstable' && 'Oldstable' || matrix.variant == 'stable'
|
|
&& 'Stable' || matrix.variant == 'sid' && 'Sid/Unstable' }}
|
|
runs-on: docker
|
|
needs: prepare
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
#variant: ["oldstable", "stable", "sid"]
|
|
variant: ["stable"]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
driver: remote
|
|
endpoint: tcp://buildkit:8125
|
|
|
|
#- name: Log in to Registry
|
|
# uses: docker/login-action@v3
|
|
# with:
|
|
# registry: ${{ env.REGISTRY }}
|
|
# username: ${{ forgejo.actor }}
|
|
# password: ${{ secrets.PACKAGE_TOKEN }}
|
|
|
|
- name: Generate Debian tags
|
|
id: debian-tags
|
|
uses: ./.forgejo/actions/generate-image-tags
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
image-name: ${{ env.IMAGE_NAME }}
|
|
os-name: debian
|
|
os-version:
|
|
${{ matrix.variant == 'oldstable' && needs.prepare.outputs.debian-oldstable ||
|
|
matrix.variant == 'stable' && needs.prepare.outputs.debian-stable || matrix.variant
|
|
== 'sid' && needs.prepare.outputs.debian-sid }}
|
|
node-version:
|
|
${{ matrix.variant == 'oldstable' && needs.prepare.outputs.node-previous ||
|
|
matrix.variant == 'stable' && needs.prepare.outputs.node-latest || matrix.variant ==
|
|
'sid' && needs.prepare.outputs.node-unstable }}
|
|
python-version:
|
|
${{ matrix.variant == 'oldstable' && needs.prepare.outputs.debian-oldstable-python ||
|
|
matrix.variant == 'stable' && needs.prepare.outputs.debian-stable-python ||
|
|
matrix.variant == 'sid' && needs.prepare.outputs.debian-sid-python }}
|
|
variant: ${{ matrix.variant == 'stable' && 'latest' || matrix.variant }}
|
|
branch-name: ${{ forgejo.ref_name }}
|
|
|
|
- name: Build and push Debian image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ./docker
|
|
file: ./docker/debian.Dockerfile
|
|
#push: true
|
|
push: false
|
|
tags: ${{ steps.debian-tags.outputs.tags }}
|
|
build-args: |
|
|
DEBIAN_TAG=${{ matrix.variant == 'oldstable' && needs.prepare.outputs.debian-oldstable-tag || matrix.variant == 'stable' && needs.prepare.outputs.debian-stable-tag || matrix.variant == 'sid' && needs.prepare.outputs.debian-sid-tag }}
|
|
DEBIAN_VERSION=${{ matrix.variant == 'oldstable' && needs.prepare.outputs.debian-oldstable || matrix.variant == 'stable' && needs.prepare.outputs.debian-stable || matrix.variant == 'sid' && needs.prepare.outputs.debian-sid }}
|
|
# TODO: Re-enable multi-arch when build environment supports it
|
|
# Current issue (2025): Python 3.12+ segfaults under QEMU user-mode emulation
|
|
# on TrueNAS kernel (6.12.15-production+truenas). Affects arm64/ppc64le/s390x.
|
|
# Tested latest QEMU (docker/setup-qemu-action@v3) - still fails.
|
|
platforms: linux/amd64
|