Skip to content

experiment docker push #39

experiment docker push

experiment docker push #39

Workflow file for this run

name: Build images (with Katsu)
env:
KATSU_BUILD_TASK_NAME: "Build image"
DNF_PKGS: |
git
xorriso
rpm
limine
systemd
btrfs-progs
e2fsprogs
xfsprogs
dosfstools
grub2
parted
util-linux-core
systemd-container
grub2-efi
uboot-images-armv8
uboot-tools
rustc
qemu-user-static-aarch64
qemu-user-binfmt
qemu-kvm
qemu-img
cargo
systemd-devel
mkpasswd
clang-devel
moby-engine
squashfs-tools
erofs-utils
grub2-tools
grub2-tools-extra
isomd5sum
moby-engine
podman
buildah
on:
push:
workflow_dispatch:
jobs:
#### BASE IMAGES ####
image:
strategy:
fail-fast: false
matrix:
variant:
- base/base-disk-x86_64
- base/base-disk-aarch64
runs-on: ubuntu-latest
container:
image: ghcr.io/terrapkg/builder:f38
# Pass /dev from host to container
# Very hacky, but it works
# Microsoft/Github, if you're reading this,
# I'm sorry.
options: --privileged -v /dev:/dev
steps:
- name: Install dependencies
run: |
dnf install -y $DNF_PKGS
dnf clean all
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Clone Katsu
uses: actions/checkout@v3
with:
repository: FyraLabs/katsu
ref: main
path: katsu
- name: Build Katsu
run: |
pushd katsu
cargo build --release
cp target/release/katsu /usr/bin/katsu
popd
- name: Checkout
uses: actions/checkout@v2
- name: ${{ env.KATSU_BUILD_TASK_NAME }}
run: |
pushd katsu
katsu --output=disk-image modules/${{ matrix.variant }}.yaml
xz -z9 katsu-work/image/katsu.img -c > katsu-work/image/katsu-arm.img.xz
popd
- name: sanitize artifact name
run: |
name=$(echo ${{ matrix.variant }} | sed 's/\//-/g')
# set github variable
echo artifact=$name >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact }}-image
path: katsu/katsu-work/image/*.img.xz
#### DOCKER ######
docker:
strategy:
fail-fast: false
matrix:
variant:
- base/base-docker-x86_64
- base/base-docker-aarch64
outputs:
artifact: ${{ matrix.variant }}
runs-on: ubuntu-latest
container:
image: ghcr.io/terrapkg/builder:f38
# Pass /dev from host to container
# Very hacky, but it works
# Microsoft/Github, if you're reading this,
# I'm sorry.
options: --privileged -v /dev:/dev
steps:
- name: Install dependencies
run: |
dnf install -y $DNF_PKGS
dnf clean all
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Clone Katsu
uses: actions/checkout@v3
with:
repository: FyraLabs/katsu
ref: main
path: katsu
- name: Build Katsu
run: |
pushd katsu
cargo build --release
cp target/release/katsu /usr/bin/katsu
popd
- name: Checkout
uses: actions/checkout@v2
- name: ${{ env.KATSU_BUILD_TASK_NAME }}
run: |
pushd katsu
katsu --output=fs modules/${{ matrix.variant }}.yaml
# tarball katsu-work/chroot
tar -C katsu-work/chroot -c . | xz -z9 -c > katsu-work/image/katsu.tar.xz
popd
- name: sanitize artifact name
run: |
name=$(echo ${{ matrix.variant }} | sed 's/\//-/g')
# set github variable
echo artifact=$name >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact }}-docker
path: katsu/katsu-work/image/*.tar.xz
#### DOCKER PUSH ######
docker-push:
strategy:
fail-fast: false
runs-on: ubuntu-latest
needs: docker
container:
image: ghcr.io/terrapkg/builder:f38
# Pass /dev from host to container
# Very hacky, but it works
# Microsoft/Github, if you're reading this,
# I'm sorry.
options: --privileged -v /dev:/dev
steps:
- name: Install dependencies
run: |
dnf install -y $DNF_PKGS
dnf clean all
- name: Login to ghcr.io
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to ghcr.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
# how do i combine those two images into one multiarch tag
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Publish to registry
run: |
ls -lR
buildah manifest create manifest
buildah manifest add manifest oci-archive:build/base-base-docker-x86_64-image.tar.xz
buildah manifest add manifest oci-archive:build/base-base-docker-aarch64-image.tar.xz
buildah manifest push --format v2s2 manifest docker://ghcr.io/ultramarine-linux/ultramarine:39
#### LIVE ISO ####
live-iso:
strategy:
fail-fast: false
matrix:
variant:
- flagship/flagship-live
- gnome/gnome-live
- kde/kde-live
- pantheon/pantheon-live
runs-on: ubuntu-latest
container:
image: ghcr.io/terrapkg/builder:f38
# Pass /dev from host to container
# Very hacky, but it works
# Microsoft/Github, if you're reading this,
# I'm sorry.
options: --privileged -v /dev:/dev
steps:
- name: Install dependencies
run: |
dnf install -y $DNF_PKGS
dnf clean all
- name: Clone Katsu
uses: actions/checkout@v3
with:
repository: FyraLabs/katsu
ref: main
path: katsu
- name: Build Katsu
run: |
pushd katsu
cargo build --release
cp target/release/katsu /usr/bin/katsu
popd
- name: Checkout
uses: actions/checkout@v2
- name: ${{ env.KATSU_BUILD_TASK_NAME }}
run: |
pushd katsu
katsu --output=iso modules/${{ matrix.variant }}.yaml
popd
- name: sanitize artifact name
run: |
name=$(echo ${{ matrix.variant }} | sed 's/\//-/g')
# set github variable
echo artifact=$name >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact }}-iso
path: katsu/out.iso