mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 05:10:55 +00:00
workflows: upload os images on build
This commit is contained in:
parent
334d27a6a4
commit
f1eedd1667
8
.github/workflows/os.yml
vendored
8
.github/workflows/os.yml
vendored
@ -3,9 +3,11 @@ on:
|
|||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- "os/**"
|
- "os/**"
|
||||||
|
- "hack/os/**"
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- "os/**"
|
- "os/**"
|
||||||
|
- "hack/os/**"
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: build
|
name: build
|
||||||
@ -16,3 +18,9 @@ jobs:
|
|||||||
- run: ./hack/os/build.sh
|
- run: ./hack/os/build.sh
|
||||||
env:
|
env:
|
||||||
KRATA_KERNEL_BUILD_JOBS: "5"
|
KRATA_KERNEL_BUILD_JOBS: "5"
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: krata-os-x86_64
|
||||||
|
path: "target/os/krata.qcow2"
|
||||||
|
compression-level: 0
|
||||||
|
|
@ -16,14 +16,18 @@ docker run --rm --privileged -v "${PWD}:/mnt" -it alpine:latest "/mnt/os/interna
|
|||||||
sudo chown "${USER}:${GROUP}" "${TARGET_OS_DIR}/rootfs.tgz"
|
sudo chown "${USER}:${GROUP}" "${TARGET_OS_DIR}/rootfs.tgz"
|
||||||
sudo modprobe nbd
|
sudo modprobe nbd
|
||||||
|
|
||||||
NBD_DEVICE="$(find /dev -maxdepth 2 -name 'nbd[0-9]*' | while read -r DEVICE
|
next_nbd_device() {
|
||||||
do
|
find /dev -maxdepth 2 -name 'nbd[0-9]*' | while read -r DEVICE
|
||||||
|
do
|
||||||
if [ "$(sudo blockdev --getsize64 "${DEVICE}")" = "0" ]
|
if [ "$(sudo blockdev --getsize64 "${DEVICE}")" = "0" ]
|
||||||
then
|
then
|
||||||
echo "${DEVICE}"
|
echo "${DEVICE}"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done)"
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
NBD_DEVICE="$(next_nbd_device)"
|
||||||
|
|
||||||
if [ -z "${NBD_DEVICE}" ]
|
if [ -z "${NBD_DEVICE}" ]
|
||||||
then
|
then
|
||||||
|
Loading…
Reference in New Issue
Block a user