Files
llvm-mingw/.github/workflows/docker.yml
T
Martin Storsjö 04bc2bc1c5 github: Build the whole multiplatform docker image with Dockerfile.toolchain
This makes the docker image contain a PGO optimized compiler,
without needing to redo all of the PGO build stages in docker.

This reverts commit 8f42112719,
and fixes building the multiplatform image in a simpler way.

Instead of doing two separate builds, with separate Dockerfiles,
just do one multiplatform build of one Dockerfile, which
docker runs serially, for each one of the included architectures,
just packaging the prebuilt toolchains in the docker image.
2025-06-25 11:51:07 +03:00

101 lines
2.7 KiB
YAML

name: Build docker images
on:
workflow_dispatch:
inputs:
ref:
description: 'Ref to extract from'
type: string
default: 'master'
login:
description: 'Log in to Docker Hub'
type: boolean
default: true
push:
description: 'Push the built images'
type: boolean
default: false
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
TAG: ${{steps.get-parameters.outputs.TAG}}
steps:
- name: Download build parameters
uses: dawidd6/action-download-artifact@v10
with:
workflow: build.yml
workflow_conclusion: success
ref: ${{inputs.ref}}
event: push
name: parameters
- name: Get build parameters
id: get-parameters
run: |
cat parameters.txt >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
docker-build-dev:
needs: [prepare]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{inputs.ref}}
- name: Log in to Docker Hub
if: ${{inputs.login}}
uses: docker/login-action@v3
with:
username: ${{vars.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_PASSWORD}}
- name: Build Docker images
uses: docker/build-push-action@v5
with:
context: .
push: ${{inputs.push}}
file: ./Dockerfile.dev
tags: |
mstorsjo/llvm-mingw:dev
mstorsjo/llvm-mingw:dev-${{needs.prepare.outputs.TAG}}
- name: Inspect Docker images
run: |
docker images
docker-build:
needs: [prepare]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{inputs.ref}}
- name: Download toolchain
uses: dawidd6/action-download-artifact@v10
with:
workflow: build.yml
workflow_conclusion: success
ref: ${{inputs.ref}}
event: push
name: linux-ucrt-.*
name_is_regexp: true
path: toolchain
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
if: ${{inputs.login}}
uses: docker/login-action@v3
with:
username: ${{vars.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_PASSWORD}}
- name: Build Docker images
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{inputs.push}}
file: ./Dockerfile.toolchain
tags: |
mstorsjo/llvm-mingw:latest
mstorsjo/llvm-mingw:${{needs.prepare.outputs.TAG}}