Skip to content

docs(ssot),fix(sbom): retarget every PACKAGES.md citation at mios.toml #179

docs(ssot),fix(sbom): retarget every PACKAGES.md citation at mios.toml

docs(ssot),fix(sbom): retarget every PACKAGES.md citation at mios.toml #179

Workflow file for this run

name: mios-ci
# In-repo build: MiOS owns the Containerfile and Justfile, so CI builds
# straight from the repository tree -- no cross-repo fetch.
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: mios-dev/mios
jobs:
build:
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read VERSION
id: ver
run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Compute tags
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=${{ steps.ver.outputs.version }},enable={{is_default_branch}}
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./Containerfile
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: true
sbom: true
# Rechunking produces 5-10x smaller Day-2 deltas (Justfile:rechunk).
# Only worth the cost on tag pushes; branch builds skip it.
- name: Install podman
if: startsWith(github.ref, 'refs/tags/v')
run: |
sudo apt-get update -qq
sudo apt-get install -y podman
- name: Rechunk on tag
if: startsWith(github.ref, 'refs/tags/v')
env:
IMAGE_TAG: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.ver.outputs.version }}
run: |
podman pull "${IMAGE_TAG}"
podman run --rm \
--security-opt label=type:unconfined_t \
-v /var/lib/containers/storage:/var/lib/containers/storage \
"${IMAGE_TAG}" \
/usr/libexec/bootc-base-imagectl rechunk --max-layers 67 \
"containers-storage:${IMAGE_TAG}" \
"containers-storage:${IMAGE_TAG}-rechunked"
podman tag "${IMAGE_TAG}-rechunked" "${IMAGE_TAG}"
podman tag "${IMAGE_TAG}" "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
podman push "${IMAGE_TAG}"
podman push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
- name: Install cosign
if: startsWith(github.ref, 'refs/tags/v')
uses: sigstore/cosign-installer@v3
- name: Cosign keyless sign
if: startsWith(github.ref, 'refs/tags/v')
env:
COSIGN_EXPERIMENTAL: '1'
run: |
for tag in $(echo "${{ steps.meta.outputs.tags }}" | tr "\n" " "); do
cosign sign --yes "${tag}"
done
smoke-test:
runs-on: ubuntu-24.04
needs: build
if: github.event_name == 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install podman
run: |
sudo apt-get update -qq
sudo apt-get install -y podman
- name: Smoke build (lint via Containerfile final RUN)
run: |
podman build -t mios:smoke -f Containerfile .