Skip to content

fix: colorize shell ls aliases #10

fix: colorize shell ls aliases

fix: colorize shell ls aliases #10

Workflow file for this run

name: release cpp docker images
on:
push:
tags:
- "bookworm-v*"
workflow_dispatch:
inputs:
image_version:
description: "Image tag to publish"
required: true
default: "manual-test"
permissions:
contents: read
packages: write
env:
DOCKERFILE: Dockerfile.toolchain
PLATFORMS: linux/amd64,linux/arm64
DEBIAN_VERSION: bookworm
RUNTIME_BASE_IMAGE: gcr.io/distroless/cc-debian12:nonroot
UV_VERSION: 0.11.10
CONAN_VERSION: 2.28.1
PYTHON_VERSION: 3.12.0
jobs:
release-images:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- target: runtime-base
image: cpp-runtime-base
- target: runtime-debug-base
image: cpp-runtime-debug-base
- target: builder-gcc
image: cpp-builder-gcc
- target: builder-clang
image: cpp-builder-clang
- target: dev-gcc
image: cpp-dev-gcc
- target: dev-clang
image: cpp-dev-clang
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set image version
shell: bash
run: |
set -euo pipefail
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
IMAGE_VERSION="${{ github.event.inputs.image_version }}"
else
IMAGE_VERSION="${GITHUB_REF_NAME}"
fi
if [[ ! "${IMAGE_VERSION}" =~ ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}$ ]]; then
echo "::error::Invalid Docker tag: ${IMAGE_VERSION}"
exit 1
fi
echo "IMAGE_VERSION=${IMAGE_VERSION}" >> "$GITHUB_ENV"
- name: Configure registries
shell: bash
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
set -euo pipefail
echo "GHCR_OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> "$GITHUB_ENV"
if [[ -n "${DOCKERHUB_USERNAME}" && -n "${DOCKERHUB_TOKEN}" ]]; then
echo "PUBLISH_DOCKERHUB=true" >> "$GITHUB_ENV"
echo "DOCKERHUB_NAMESPACE=${DOCKERHUB_USERNAME}" >> "$GITHUB_ENV"
else
echo "PUBLISH_DOCKERHUB=false" >> "$GITHUB_ENV"
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to Docker Hub
if: env.PUBLISH_DOCKERHUB == 'true'
uses: docker/login-action@v4
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ env.GHCR_OWNER }}/${{ matrix.image }}
${{ env.PUBLISH_DOCKERHUB == 'true' && format('docker.io/{0}/{1}', env.DOCKERHUB_NAMESPACE, matrix.image) || '' }}
tags: |
type=raw,value=${{ env.IMAGE_VERSION }}
- name: Build and push ${{ matrix.image }}
uses: docker/build-push-action@v7
with:
context: .
file: ${{ env.DOCKERFILE }}
target: ${{ matrix.target }}
platforms: ${{ env.PLATFORMS }}
push: true
build-args: |
DEBIAN_VERSION=${{ env.DEBIAN_VERSION }}
RUNTIME_BASE_IMAGE=${{ env.RUNTIME_BASE_IMAGE }}
UV_VERSION=${{ env.UV_VERSION }}
CONAN_VERSION=${{ env.CONAN_VERSION }}
PYTHON_VERSION=${{ env.PYTHON_VERSION }}
IMAGE_SOURCE=https://github.com/${{ github.repository }}
IMAGE_REVISION=${{ github.sha }}
IMAGE_VERSION=${{ env.IMAGE_VERSION }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.target }}
cache-to: type=gha,mode=max,scope=${{ matrix.target }}
provenance: true
sbom: true