fix: patch welcome screen for KDE #112
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- flagship/flagship-chromebook | |
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: lleyton/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: sanitize artifact name | |
run: | | |
name=$(echo ${{ matrix.variant }} | sed 's/\//-/g') | |
# set github variable | |
echo artifact=$name >> $GITHUB_ENV | |
# Get architecture | |
# e.g. base/base-disk-x86_64 -> x86_64 | |
echo arch=$(echo ${{ matrix.variant }} | cut -d'-' -f3) >> $GITHUB_ENV | |
- name: ${{ env.KATSU_BUILD_TASK_NAME }} | |
run: | | |
pushd katsu | |
KATSU_LOG=trace katsu -v --output=disk-image modules/${{ matrix.variant }}.yaml | |
xz -z9 katsu-work/image/katsu.img -c > katsu-work/image/ultramarine-39-${{ env.arch }}.img.xz | |
popd | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.artifact }}-image | |
path: katsu/katsu-work/image/*.img.xz | |
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: lleyton/katsu | |
ref: main | |
path: katsu | |
- name: Build Katsu | |
run: | | |
pushd katsu | |
cargo build --release | |
cp target/release/katsu /usr/bin/katsu | |
popd | |
- name: sanitize artifact name | |
run: | | |
name=$(echo ${{ matrix.variant }} | sed 's/\//-/g') | |
# set github variable | |
echo artifact=$name >> $GITHUB_ENV | |
# Get variant name from path | |
# e.g. flagship/flagship-live -> flagship | |
echo variant=$(echo ${{ matrix.variant }} | cut -d'/' -f1) >> $GITHUB_ENV | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: ${{ env.KATSU_BUILD_TASK_NAME }} | |
run: | | |
pushd katsu | |
katsu --output=iso modules/${{ matrix.variant }}.yaml | |
popd | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.artifact }}-iso | |
path: katsu/*.iso | |
#### LIVE ISO PUSH #### | |
push-image: | |
runs-on: ubuntu-latest | |
environment: production | |
needs: | |
- live-iso | |
- image | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- name: sanitize artifact name | |
run: | | |
name=$(echo ${{ needs.live-iso.outputs.artifact }} | sed 's/\//-/g') | |
# set github variable | |
echo artifact=$name >> $GITHUB_ENV | |
# Get variant name from path | |
# e.g. flagship/flagship-live -> flagship | |
echo variant=$(echo ${{ needs.live-iso.outputs.artifact }} | cut -d'-' -f1) >> $GITHUB_ENV | |
- name: Generate artifact tree | |
run: | | |
set | |
ls -lR | |
mkdir -p images | |
# for folder in artifacts | |
pack_image() { | |
file=$1 | |
type=$2 | |
IMAGEDIR=images/$type/ultramarine/39/ | |
mkdir -p $IMAGEDIR | |
filename=$(basename -- "$file") | |
# create sha256sum | |
sha256sum $file > $IMAGEDIR/$filename.sha256sum | |
mv $file $IMAGEDIR | |
} | |
for file in artifacts/*-iso/*; do | |
# if is file | |
if [ -f "$file" ]; then | |
pack_image $file isos | |
fi | |
done | |
for file in artifacts/*-image/*; do | |
# if is file | |
if [ -f "$file" ]; then | |
pack_image $file images | |
fi | |
done | |
- name: Upload to R2 | |
uses: shallwefootball/s3-upload-action@master | |
with: | |
endpoint: ${{ secrets.S3_ENDPOINT }} | |
aws_key_id: ${{ secrets.S3_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.S3_SECRET_KEY }} | |
aws_bucket: "images" | |
source_dir: "images" | |
destination_dir: "" |