Skip to content

Build images

Build images #67

Workflow file for this run

name: Build images
# This workflow builds all cdxgen images.
#
# In this file we define all the images, the actual building is done in
# `image-build.yml`.
#
# An image definition looks like this:
#
# lang: Language+version the image will be built for -- mandatory
# distro: Distribution the image is based on -- default: 'bci' (defined in `image-build.yml`)
# fix-qemu: Fix the QEMU installation on the build-server -- default: false
# runner: Hint/name of the server to run the build on -- default: 'ubuntu-24.04' (defined in `image-build.yml`)
# skip-arm: Do not build an ARM64-version of this image -- default: false
# base-image: Configuration specific to the base-image -- optional
# additional-image: Additional name for the base-image -- optional
# lang: Override the lang for just the base-image -- historical, should not be used for new images
# name: Override the distro for just the base-image -- historical, should not be used for new images
# cdxgen-image: Configuration specific to the cdxgen-image -- optional
# additional-image: Additional name for the cdxgen-image -- optional
# additional-image2: As above -- optional
# additional-image3: As above -- optional
#
# The actual names of the images are then constructed from the above parameters
# like this (plus any and all defined additional-names):
#
# base-image: ${ base-image.name || distro }-${ base-image.lang || lang }:${ 'master' || 'vX.X.X' }
# cdxgen-image: cdxgen${ -distro }-${ lang }:${ image-build.yml#TAG || 'vX.X.X' }
#
# The above configurations are also used to lookup the location of the
# 'Dockerfile' for the images:
#
# ci/images/${ distro }/Dockerfile.${ lang }
on:
push:
tags:
- 'v*'
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
inputs:
latest:
description: Tag the images as 'latest' on top of the given tags
required: true
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
permissions: {}
jobs:
images:
permissions:
packages: write # needed for publishing images on GH package registry
if: github.repository == 'CycloneDX/cdxgen'
strategy:
fail-fast: false
matrix:
image:
- lang: dotnet6
distro: debian
- lang: dotnet7
skip-arm: true
- lang: dotnet8
skip-arm: true
- lang: dotnet8
distro: debian
runner: macos-hosted
- lang: dotnet9
skip-arm: true
- lang: dotnet9
distro: alpine
- lang: dotnet9
distro: debian
runner: macos-hosted
- lang: dotnet10
distro: debian
runner: macos-hosted
- lang: golang123
distro: alpine
- lang: golang123
distro: debian
- lang: golang124
distro: alpine
base-image:
additional-image: alpine-golang
cdxgen-image:
additional-image: cdxgen-alpine-golang
- lang: golang124
distro: debian
base-image:
additional-image: debian-golang
cdxgen-image:
additional-image: cdxgen-golang
additional-image2: cdxgen-debian-golang
- lang: java8
distro: temurin
- lang: java11
base-image:
additional-image: java11-slim
cdxgen-image:
additional-image: cdxgen-java
additional-image2: cdxgen-java11-slim
additional-image3: cdxgen-java-slim
- lang: java17
- lang: java17-slim
- lang: java21
distro: alpine
- lang: java21
distro: temurin
- lang: java24
distro: alpine
- lang: java24
distro: temurin
- lang: node20
cdxgen-image:
additional-image: cdxgen-node
- lang: node20
distro: alpine
- lang: node24
distro: alpine
- lang: php83
distro: debian
runner: macos-hosted
- lang: php84
distro: alpine
- lang: php84
distro: debian
runner: macos-hosted
- lang: python36
- lang: python39
distro: opensuse
runner: macos-hosted
cdxgen-image:
additional-image: cdxgen-python39
- lang: python310
distro: opensuse
runner: macos-hosted
cdxgen-image:
additional-image: cdxgen-python310
- lang: python311
- lang: python312
base-image:
lang: lang
cdxgen-image:
additional-image: cdxgen-python
- lang: python313
- lang: ruby25
fix-qemu: true
skip-arm: true
base-image:
name: sle
- lang: ruby26
distro: debian
skip-arm: true
- lang: ruby33
distro: debian
runner: macos-hosted
- lang: ruby34
distro: debian
- lang: ruby34
distro: alpine
- lang: rust1
distro: debian
base-image:
additional-image: debian-rust
cdxgen-image:
additional-image: cdxgen-debian-rust
- lang: swift6
distro: debian
base-image:
additional-image: debian-swift
cdxgen-image:
additional-image: cdxgen-debian-swift
uses: ./.github/workflows/image-build.yml
secrets: inherit
with:
image: ${{ toJSON(matrix.image) }}
latest: ${{ inputs.latest || startsWith(github.ref, 'refs/tags/') }}
retry:
needs: images
if: failure() && fromJSON(github.run_attempt) < 3
runs-on: ubuntu-latest
steps:
- run: gh workflow run rerun-workflow.yml -F run_id=${{ github.run_id }}
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}