ci: rework build
Some checks failed
Build containers / Build and push image (linux/arm64, asahi-cosmic, 43) (push) Failing after 4s
Some checks failed
Build containers / Build and push image (linux/arm64, asahi-cosmic, 43) (push) Failing after 4s
This commit is contained in:
@@ -17,27 +17,12 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
image: [asahi-cosmic]
|
image: [asahi-cosmic]
|
||||||
version: [43] #Build current stable,next stable/rawhide (if not branched)
|
version: [43] #Build current stable,next stable/rawhide (if not branched)
|
||||||
|
arch: [linux/arm64] #todo fix
|
||||||
container:
|
|
||||||
image: "quay.io/fedora-ostree-desktops/buildroot:43"
|
|
||||||
options: "--security-opt apparmor=unconfined --privileged --user 0:0 --device=/dev/kvm --device=/dev/fuse --volume /:/run/host:rw --arch arm64"
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
dnf install -y nodejs
|
|
||||||
dnf upgrade -y --enablerepo=updates-testing --refresh rpm-ostree
|
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Build Bootable Container image
|
|
||||||
run: |
|
|
||||||
./builder.sh "${{ matrix.image }}" "${{ matrix.version }}"
|
|
||||||
|
|
||||||
- name: Prepare Docker config directory
|
|
||||||
run: mkdir -p /root/.docker
|
|
||||||
|
|
||||||
- name: Login to Container Registry
|
- name: Login to Container Registry
|
||||||
uses: redhat-actions/podman-login@v1
|
uses: redhat-actions/podman-login@v1
|
||||||
if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
|
if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
|
||||||
@@ -45,39 +30,20 @@ jobs:
|
|||||||
registry: git.plabble.org
|
registry: git.plabble.org
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
auth_file_path: /tmp/auth.json
|
|
||||||
|
|
||||||
- name: Push container image to container registry
|
- name: Build
|
||||||
id: push
|
id: build
|
||||||
run: |
|
uses: job79/buildah-build@65b3793a1370c1ccd74a5c0d090d70eb9637a4ef
|
||||||
# Determine buildid (same logic as upstream)
|
with:
|
||||||
if [[ -f ".buildid" ]]; then
|
image: misthios/${{ matrix.image}}
|
||||||
buildid="$(< .buildid)"
|
tags: ${{ matrix.version }}
|
||||||
else
|
context: ./
|
||||||
buildid="$(date '+%Y%m%d.0')"
|
containerfiles: ./Containerfile
|
||||||
echo "${buildid}" > .buildid
|
platforms: ${{ matrix.arch }}
|
||||||
fi
|
build-args : |
|
||||||
|
VERSION=${{ matrix.version }}
|
||||||
version="${{ matrix.version }}"
|
IMAGE=${{ matrix.image }}
|
||||||
image="${{ matrix.image }}"
|
extra-args: |
|
||||||
|
--cap-add=all
|
||||||
# Path to the OCI archive produced by builder.sh
|
--device /dev/fuse
|
||||||
archive="images/${image}/manifest.ociarchive"
|
--security-opt=label=disable
|
||||||
|
|
||||||
echo "Pushing ${archive} as ${image}:${version}.${buildid}"
|
|
||||||
|
|
||||||
# Push version.buildid
|
|
||||||
skopeo copy \
|
|
||||||
--authfile /tmp/auth.json \
|
|
||||||
--retry-times 3 \
|
|
||||||
--dest-compress-format zstd \
|
|
||||||
oci-archive:${archive} \
|
|
||||||
docker://git.plabble.org/misthios/${image}:${version}.${buildid}
|
|
||||||
|
|
||||||
# Push version
|
|
||||||
skopeo copy \
|
|
||||||
--authfile /tmp/auth.json \
|
|
||||||
--retry-times 3 \
|
|
||||||
--dest-compress-format zstd \
|
|
||||||
docker://git.plabble.org/misthios/${image}:${version}.${buildid} \
|
|
||||||
docker://git.plabble.org/misthios/${image}:${version}
|
|
||||||
|
|||||||
24
Containerfile
Normal file
24
Containerfile
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
ARG IMAGE=base
|
||||||
|
ARG VERSION=44
|
||||||
|
|
||||||
|
FROM quay.io/fedora/fedora:${VERSION} as builder
|
||||||
|
|
||||||
|
#Install deps and the latest rpm-ostree
|
||||||
|
RUN dnf -y install rpm-ostree selinux-policy-targeted python3 && dnf upgrade -y --enablerepo=updates-testing --refresh rpm-ostree
|
||||||
|
|
||||||
|
#Copy all files into the container and set permissions
|
||||||
|
COPY . /src
|
||||||
|
RUN chmod -R a=rX,u+w /src
|
||||||
|
WORKDIR /src
|
||||||
|
|
||||||
|
#Build the wanted image and version
|
||||||
|
RUN ./builder.sh ${IMAGE} ${VERSION}
|
||||||
|
|
||||||
|
# Create the container and set the labels
|
||||||
|
FROM scratch
|
||||||
|
COPY --from=builder /src/images/${IMAGE}/manifest.ociarchive /
|
||||||
|
LABEL containers.bootc 1
|
||||||
|
ENV container=oci
|
||||||
|
# Make systemd the default
|
||||||
|
STOPSIGNAL SIGRTMIN+3
|
||||||
|
CMD ["/sbin/init"]
|
||||||
@@ -62,7 +62,6 @@ else
|
|||||||
echo "No postprocess.sh found in ${IMAGE_DIR}, skipping."
|
echo "No postprocess.sh found in ${IMAGE_DIR}, skipping."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# --- COMPOSE IMAGE ---
|
# --- COMPOSE IMAGE ---
|
||||||
ARGS=(
|
ARGS=(
|
||||||
"--cachedir=cache"
|
"--cachedir=cache"
|
||||||
@@ -70,7 +69,7 @@ ARGS=(
|
|||||||
"--max-layers=96"
|
"--max-layers=96"
|
||||||
)
|
)
|
||||||
|
|
||||||
rpm-ostree compose image \
|
rpm-ostree compose rootfs \
|
||||||
"${ARGS[@]}" \
|
"${ARGS[@]}" \
|
||||||
"$MANIFEST" \
|
"$MANIFEST" \
|
||||||
"$OUTPUT"
|
"$OUTPUT"
|
||||||
Reference in New Issue
Block a user