mirror of
https://github.com/NewFuture/DDNS.git
synced 2026-10-21 05:26:51 +00:00
Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
168 lines
5.5 KiB
YAML
168 lines
5.5 KiB
YAML
name: nuitka builder
|
|
|
|
run-name: Build nuitka(${{ inputs.nuitka || 'main' }}) docker with python${{ inputs.python || '3.8' }} on ${{github.ref_name}} by @${{ github.actor }}
|
|
|
|
on:
|
|
push:
|
|
branches: ["master", "main"]
|
|
paths:
|
|
- 'docker/*'
|
|
- '.github/workflows/build-nuitka-docker.yml'
|
|
workflow_dispatch:
|
|
inputs:
|
|
python:
|
|
description: 'Python version'
|
|
required: false
|
|
default: '3.8'
|
|
nuitka:
|
|
description: 'Nuitka version'
|
|
required: false
|
|
default: 'main'
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
env:
|
|
DOCKER_IMAGE: ghcr.io/newfuture/nuitka-builder
|
|
NUITKA_VERSION: ${{ inputs.nuitka || 'main' }}
|
|
PYTHON_VERSION: ${{ inputs.python || '3.8' }}
|
|
FULL_TAG: ${{ inputs.nuitka || 'main' }}-py${{ inputs.python || '3.8' }}
|
|
jobs:
|
|
bin-builder:
|
|
timeout-minutes: 10
|
|
strategy:
|
|
matrix:
|
|
host: ['amd', 'arm',]
|
|
type: ['glibc', 'musl']
|
|
env:
|
|
platforms: >-
|
|
${{ matrix.host == 'amd' && 'linux/386,linux/amd64' ||
|
|
matrix.type == 'glibc' && 'linux/arm/v7,linux/arm64/v8' ||
|
|
'linux/arm/v6,linux/arm/v7,linux/arm64/v8' }}
|
|
environment:
|
|
name: preview
|
|
url: https://github.com/NewFuture/DDNS/pkgs/container/nuitka-builder/
|
|
runs-on: ubuntu-${{ matrix.host == 'arm' && '24.04-arm' || 'latest' }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: docker/login-action@v4
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: docker/setup-buildx-action@v4
|
|
- uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
file: docker/${{ matrix.type }}.Dockerfile
|
|
platforms: ${{ env.platforms }}
|
|
target: base-builder
|
|
push: true
|
|
tags: ${{env.DOCKER_IMAGE}}:${{ matrix.type }}-${{ matrix.host }}
|
|
build-args: |
|
|
PYTHON_VERSION=${{ env.PYTHON_VERSION }}
|
|
NUITKA_VERSION=${{ env.NUITKA_VERSION }}
|
|
|
|
docker-builder:
|
|
timeout-minutes: ${{ matrix.host == 'qemu' && 30 || 10 }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- host: amd
|
|
platforms: 'linux/386,linux/amd64'
|
|
- host: arm
|
|
platforms: 'linux/arm/v6,linux/arm/v7,linux/arm64/v8'
|
|
- host: qemu
|
|
platforms: 'linux/ppc64le,linux/riscv64,linux/s390x'
|
|
environment:
|
|
name: preview
|
|
url: https://github.com/NewFuture/DDNS/pkgs/container/nuitka-builder/
|
|
runs-on: ubuntu-${{ matrix.host == 'arm' && '24.04-arm' || 'latest' }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: docker/login-action@v4
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: docker/setup-qemu-action@v4
|
|
if: matrix.host == 'qemu'
|
|
with:
|
|
platforms: ${{ matrix.platforms }}
|
|
|
|
- uses: docker/setup-buildx-action@v4
|
|
|
|
- uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
file: docker/Dockerfile
|
|
platforms: ${{ matrix.platforms }}
|
|
target: base-builder
|
|
push: true
|
|
tags: ${{env.DOCKER_IMAGE}}:${{ matrix.host }}
|
|
build-args: |
|
|
PYTHON_VERSION=${{ env.PYTHON_VERSION }}
|
|
NUITKA_VERSION=${{ env.NUITKA_VERSION }}
|
|
|
|
merge-bin-builder:
|
|
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
|
needs: [bin-builder]
|
|
strategy:
|
|
matrix:
|
|
type: ['glibc', 'musl']
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
environment:
|
|
name: preview
|
|
url: https://github.com/NewFuture/DDNS/pkgs/container/nuitka-builder/
|
|
steps:
|
|
- uses: docker/login-action@v4
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: docker/setup-buildx-action@v4
|
|
- name: Merge images
|
|
run: |
|
|
set -ex
|
|
docker buildx imagetools create \
|
|
--tag ${{env.DOCKER_IMAGE}}:${{matrix.type}}-${{ github.ref_name }} \
|
|
--tag ${{env.DOCKER_IMAGE}}:${{ env.FULL_TAG }}-${{matrix.type}} \
|
|
${{env.DOCKER_IMAGE}}:${{matrix.type}}-amd \
|
|
${{env.DOCKER_IMAGE}}:${{matrix.type}}-arm \
|
|
--annotation "index:org.opencontainers.image.description={{matrix.type}} Nuitka Builder Image (multi-arch)"
|
|
|
|
merge-docker-builder:
|
|
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
|
needs: [docker-builder]
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
environment:
|
|
name: preview
|
|
url: https://github.com/NewFuture/DDNS/pkgs/container/nuitka-builder/
|
|
steps:
|
|
- uses: docker/login-action@v4
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: docker/setup-buildx-action@v4
|
|
- name: Merge images
|
|
run: |
|
|
set -ex
|
|
docker buildx imagetools create \
|
|
--tag ${{env.DOCKER_IMAGE}} \
|
|
--tag ${{env.DOCKER_IMAGE}}:${{ github.ref_name }} \
|
|
--tag ${{env.DOCKER_IMAGE}}:${{ env.FULL_TAG }} \
|
|
${{env.DOCKER_IMAGE}}:amd \
|
|
${{env.DOCKER_IMAGE}}:arm \
|
|
${{env.DOCKER_IMAGE}}:qemu \
|
|
--annotation "index:org.opencontainers.image.description=Alpine Nuitka Builder Image (multi-arch)"
|