Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 39 additions & 5 deletions .github/workflows/next.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ name: "🏗 Next"

on:
push:
branch:
branches:
- master
tags:
- '*.*'
pull_request:

jobs:
Expand Down Expand Up @@ -36,6 +38,14 @@ jobs:
- name: Check out repo
uses: actions/checkout@v6

- name: Get release version
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
else
echo "RELEASE_VERSION=" >> $GITHUB_ENV
fi

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand All @@ -56,7 +66,9 @@ jobs:
platforms: linux/amd64
push: true
provenance: false
tags: ghcr.io/linux-nvme/${{ matrix.distro }}.staging:next
tags: |
ghcr.io/linux-nvme/${{ matrix.distro }}.staging:next
${{ env.RELEASE_VERSION && format('ghcr.io/linux-nvme/{0}.staging:main', matrix.distro) || '' }}

# ------------------------
# Step 3: Build tools using staging containers
Expand Down Expand Up @@ -100,6 +112,14 @@ jobs:
- name: Check out repo
uses: actions/checkout@v6

- name: Get release version
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
else
echo "RELEASE_VERSION=" >> $GITHUB_ENV
fi

- name: Download artifacts
uses: actions/download-artifact@v8
with:
Expand All @@ -123,11 +143,14 @@ jobs:
uses: docker/build-push-action@v6.19.2
with:
context: .
file: Dockerfile.${{ matrix.distro }}
file: main/Dockerfile.${{ matrix.distro }}
platforms: linux/amd64
push: true
provenance: false
tags: ghcr.io/linux-nvme/${{ matrix.distro }}:next
tags: |
ghcr.io/linux-nvme/${{ matrix.distro }}:next
${{ env.RELEASE_VERSION && format('ghcr.io/linux-nvme/{0}:{1}', matrix.distro, env.RELEASE_VERSION) || '' }}
${{ env.RELEASE_VERSION && format('ghcr.io/linux-nvme/{0}:latest', matrix.distro) || '' }}

deploy_cross_containers:
runs-on: ubuntu-latest
Expand All @@ -141,6 +164,15 @@ jobs:
steps:
- name: Check out repo
uses: actions/checkout@v6

- name: Get release version
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
else
echo "RELEASE_VERSION=" >> $GITHUB_ENV
fi

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand All @@ -154,9 +186,11 @@ jobs:
- name: Build image
uses: docker/build-push-action@v6.19.2
with:
file: Dockerfile.ubuntu.${{ matrix.arch }}
file: main/Dockerfile.ubuntu.${{ matrix.arch }}
platforms: linux/amd64
push: true
provenance: false
tags: |
ghcr.io/linux-nvme/ubuntu-cross-${{ matrix.arch }}:next
${{ env.RELEASE_VERSION && format('ghcr.io/linux-nvme/ubuntu-cross-{0}:{1}', matrix.arch, env.RELEASE_VERSION) || '' }}
${{ env.RELEASE_VERSION && format('ghcr.io/linux-nvme/ubuntu-cross-{0}:latest', matrix.arch) || '' }}
131 changes: 0 additions & 131 deletions .github/workflows/release.yml

This file was deleted.

22 changes: 11 additions & 11 deletions generate/Makefile → Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
DISTROS := debian fedora tumbleweed alpine
DOCKERFILES := $(addprefix ../Dockerfile.,$(DISTROS))
STAGING_DOCKERFILES := $(addprefix ../staging/Dockerfile.,$(DISTROS))
DOCKERFILES := $(addprefix main/Dockerfile.,$(DISTROS))
STAGING_DOCKERFILES := $(addprefix staging/Dockerfile.,$(DISTROS))
BUILD_TARGETS := $(addprefix build-,$(DISTROS))
STAGING_BUILD_TARGETS := $(addprefix build-staging-,$(DISTROS))

.PHONY: all help generate build staging-dockerfiles $(BUILD_TARGETS) $(STAGING_BUILD_TARGETS)

all: generate staging-dockerfiles build staging-build
all: generate build staging-build

help:
@echo "Available targets:"
@echo " all - Generate and build all containers (default)"
@echo " generate - Generate normal Dockerfiles"
@echo " generate - Generate all Dockerfiles"
@echo " staging-dockerfiles - Generate staging Dockerfiles"
@echo " build - Build normal containers"
@echo " staging-build - Build staging containers"
Expand All @@ -20,21 +20,21 @@ help:
@echo " build-staging-<distro> - Build staging container for <distro>"

# Generation targets
generate: $(DOCKERFILES)
generate: $(DOCKERFILES) $(STAGING_DOCKERFILES)
staging-dockerfiles: $(STAGING_DOCKERFILES)

../Dockerfile.%: ci-containers.yaml generate.py templates/Dockerfile.%.j2
main/Dockerfile.%: ci-containers.yaml generate.py templates/Dockerfile.%.j2
./generate.py --distro $* --bundles base,python --features muon --output $@

../staging/Dockerfile.%: ci-containers.yaml generate.py templates/Dockerfile.%.j2
staging/Dockerfile.%: ci-containers.yaml generate.py templates/Dockerfile.%.j2
./generate.py --distro $* --bundle base,staging --output $@

# Build targets
build: $(BUILD_TARGETS)
staging-build: $(STAGING_BUILD_TARGETS)

$(BUILD_TARGETS): build-%: | ../Dockerfile.%
sudo docker build -f ../Dockerfile.$* -t ci:$* .
$(BUILD_TARGETS): build-%: | main/Dockerfile.%
sudo docker build -f main/Dockerfile.$* -t ci:$* .

$(STAGING_BUILD_TARGETS): build-staging-%: | ../staging/Dockerfile.%
sudo docker build -f ../staging/Dockerfile.$* -t ci:$*-staging .
$(STAGING_BUILD_TARGETS): build-staging-%: | staging/Dockerfile.%
sudo docker build -f staging/Dockerfile.$* -t ci:$*-staging .
2 changes: 1 addition & 1 deletion build-all.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

for dockerfile in Dockerfile.*; do
for dockerfile in main/Dockerfile.*; do
docker buildx build --platform linux/amd64 . -f "${dockerfile}"
done
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading