ci: test changes
All checks were successful
Build containers / Build and push image (asahi-cosmic, 43) (push) Successful in 10m21s
All checks were successful
Build containers / Build and push image (asahi-cosmic, 43) (push) Successful in 10m21s
This commit is contained in:
@@ -15,23 +15,28 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
image: [asahi-cosmic]
|
||||
version: [43] #Build current stable,next stable/rawhide (if not branched)
|
||||
version: [43]
|
||||
|
||||
container:
|
||||
image: "quay.io/fedora-ostree-desktops/buildroot:${{ matrix.version }}"
|
||||
options: "--security-opt=label=disable --privileged --user 0:0 --device=/dev/fuse --volume /:/run/host:rw"
|
||||
|
||||
steps:
|
||||
|
||||
- name: Install latest rpm-ostree package from testing repos
|
||||
- name: Install rpm-ostree + tools
|
||||
run: |
|
||||
dnf upgrade -y --enablerepo=updates-testing --refresh rpm-ostree
|
||||
dnf install -y nodejs
|
||||
dnf install -y nodejs skopeo jq buildah rsync
|
||||
mkdir -p ~/.docker
|
||||
|
||||
|
||||
- name: Fix containers/storage.conf
|
||||
run: |
|
||||
sed -i 's/driver = "overlay"/driver = "vfs"/' /usr/share/containers/storage.conf
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in
|
||||
- name: Log in to registry
|
||||
uses: redhat-actions/podman-login@v1
|
||||
with:
|
||||
registry: git.plabble.org
|
||||
@@ -39,27 +44,72 @@ jobs:
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
auth_file_path: /tmp/auth.json
|
||||
|
||||
- name: Build rootfs
|
||||
- name: Debug paths
|
||||
run: |
|
||||
sudo ./builder.sh asahi-cosmic 43
|
||||
pwd
|
||||
ls -l
|
||||
ls -l images || echo "images/ missing"
|
||||
ls -l images/asahi-cosmic || echo "image dir missing"
|
||||
ls -l images/asahi-cosmic/manifest.yaml || echo "manifest missing"
|
||||
|
||||
- name: Build container
|
||||
id: build
|
||||
uses: job79/buildah-build@65b3793a1370c1ccd74a5c0d090d70eb9637a4ef
|
||||
with:
|
||||
image: misthios/${{ matrix.image }}
|
||||
tags: ${{ matrix.version }}
|
||||
containerfiles: ./Containerfile
|
||||
build-args: IMAGE=${{ matrix.image }}
|
||||
- name: Build rootfs with rpm-ostree
|
||||
run: |
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
sudo -E ./builder.sh "${{ matrix.image }}" "${{ matrix.version }}"
|
||||
|
||||
- name: Push
|
||||
uses: redhat-actions/push-to-registry@v2
|
||||
with:
|
||||
image: ${{ steps.build.outputs.image }}
|
||||
tags: ${{ steps.build.outputs.tags }}
|
||||
registry: git.plabble.org
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
extra-args: |
|
||||
--compression-format=zstd
|
||||
--compression-level=12
|
||||
- name: Build and push OCI image from rootfs
|
||||
run: |
|
||||
set -xeuo pipefail
|
||||
|
||||
IMAGE="${{ matrix.image }}"
|
||||
VERSION="${{ matrix.version }}"
|
||||
REGISTRY="git.plabble.org/misthios"
|
||||
|
||||
# Your builder outputs rootfs here:
|
||||
ROOTFS="images/${IMAGE}/rootfs"
|
||||
|
||||
if [[ ! -d "${ROOTFS}" ]]; then
|
||||
echo "ERROR: rootfs not found at ${ROOTFS}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Build ID (YYYYMMDD.0)
|
||||
if [[ -f ".buildid" ]]; then
|
||||
buildid="$(< .buildid)"
|
||||
else
|
||||
buildid="$(date '+%Y%m%d.0')"
|
||||
echo "${buildid}" > .buildid
|
||||
fi
|
||||
|
||||
# Use matrix version directly
|
||||
version="${VERSION}"
|
||||
full_tag="${version}.${buildid}"
|
||||
|
||||
echo "Building OCI image from rootfs..."
|
||||
|
||||
export STORAGE_DRIVER=vfs
|
||||
|
||||
ctr="$(buildah from scratch)"
|
||||
mnt="$(buildah mount "${ctr}")"
|
||||
|
||||
rsync -aHAX "${ROOTFS}/" "${mnt}/"
|
||||
|
||||
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} \
|
||||
docker://${REGISTRY}/${IMAGE}:${full_tag}
|
||||
|
||||
skopeo copy \
|
||||
--authfile /tmp/auth.json \
|
||||
containers-storage:localhost/${IMAGE}:${full_tag} \
|
||||
docker://${REGISTRY}/${IMAGE}:${version}
|
||||
|
||||
echo "Pushed:"
|
||||
echo " - ${REGISTRY}/${IMAGE}:${full_tag}"
|
||||
echo " - ${REGISTRY}/${IMAGE}:${version}"
|
||||
|
||||
Reference in New Issue
Block a user