ci: generate changelog
All checks were successful
Build containers / Build and push image (push) Successful in 10m9s

This commit is contained in:
2026-03-01 16:47:28 +01:00
parent eb47b29286
commit c658c90c40
2 changed files with 140 additions and 25 deletions

View File

@@ -11,14 +11,13 @@ jobs:
build_push:
name: Build and push image
runs-on: coole-runner
strategy:
fail-fast: false
matrix:
image: [asahi-cosmic]
version: [43]
env:
IMAGE: asahi-cosmic
VERSION: 43
container:
image: "quay.io/fedora-ostree-desktops/buildroot:${{ matrix.version }}"
image: "quay.io/fedora-ostree-desktops/buildroot:${{ env.VERSION }}"
options: "--security-opt=label=disable --privileged --user 0:0 --device=/dev/fuse --volume /:/run/host:rw"
steps:
@@ -26,7 +25,7 @@ jobs:
- name: Install rpm-ostree + tools
run: |
dnf upgrade -y --enablerepo=updates-testing --refresh rpm-ostree
dnf install -y nodejs skopeo jq buildah rsync
dnf install -y nodejs skopeo jq buildah rsync git
mkdir -p ~/.docker
- name: Fix containers/storage.conf
@@ -35,6 +34,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to registry
uses: redhat-actions/podman-login@v1
@@ -43,18 +44,15 @@ jobs:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
auth_file_path: /tmp/auth.json
- name: Build rootfs with rpm-ostree
run: |
cd "$GITHUB_WORKSPACE"
sudo -E ./builder.sh "${{ matrix.image }}" "${{ matrix.version }}"
sudo -E ./builder.sh "${IMAGE}" "${VERSION}"
- name: Build and push OCI image from rootfs
run: |
set -xeuo pipefail
IMAGE="${{ matrix.image }}"
VERSION="${{ matrix.version }}"
REGISTRY="git.plabble.org/misthios"
ROOTFS="images/${IMAGE}/rootfs"
@@ -71,10 +69,7 @@ jobs:
echo "${buildid}" > .buildid
fi
version="${VERSION}"
full_tag="${version}.${buildid}"
echo "Building OCI image from rootfs..."
full_tag="${VERSION}.${buildid}"
export STORAGE_DRIVER=vfs
@@ -83,18 +78,13 @@ jobs:
rsync -aHAX "${ROOTFS}/" "${mnt}/"
# REQUIRED FOR BOOTC
buildah config --label containers.bootc=1 "${ctr}"
buildah config --env container=oci "${ctr}"
# CMD
buildah config --cmd "/sbin/init" "${ctr}"
buildah commit "${ctr}" "localhost/${IMAGE}:${full_tag}"
buildah unmount "${ctr}"
echo "Pushing image to registry..."
skopeo copy \
--authfile /tmp/auth.json \
containers-storage:localhost/${IMAGE}:${full_tag} \
@@ -103,8 +93,17 @@ jobs:
skopeo copy \
--authfile /tmp/auth.json \
containers-storage:localhost/${IMAGE}:${full_tag} \
docker://${REGISTRY}/${IMAGE}:${version}
docker://${REGISTRY}/${IMAGE}:${VERSION}
echo "Pushed:"
echo " - ${REGISTRY}/${IMAGE}:${full_tag}"
echo " - ${REGISTRY}/${IMAGE}:${version}"
- name: Generate changelog
run: |
./changelog.sh "${IMAGE}" "${VERSION}"
- name: Commit and push changelog
if: github.ref == 'refs/heads/main'
run: |
git config user.name "Automation"
git config user.email "actions@invalid.tld"
git add changelogs/
git commit -m "Update changelog for ${IMAGE} ${VERSION} build $(cat .buildid)" || echo "No changes"
git push