2024-05-05 06:13:00 +07:00
|
|
|
#
|
2024-10-24 23:59:15 +07:00
|
|
|
# Copyright (C) 2024 AuxXxilium <https://github.com/AuxXxilium>
|
2024-05-05 06:13:00 +07:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the MIT License.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
2024-10-24 23:59:15 +07:00
|
|
|
name: Build Arc Base Dev
|
2024-05-05 06:13:00 +07:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- dev
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2024-10-02 02:21:01 +07:00
|
|
|
runs-on: ubuntu-latest
|
2024-05-05 06:13:00 +07:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@main
|
|
|
|
|
|
|
|
# Install Dependencies
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
|
|
|
git config --global user.email "info@auxxxilium.tech"
|
|
|
|
git config --global user.name "AuxXxilium"
|
|
|
|
sudo timedatectl set-timezone "Europe/Berlin"
|
|
|
|
|
|
|
|
sudo apt update
|
2024-08-29 04:02:48 +07:00
|
|
|
sudo apt install -y jq gawk cpio gettext libelf-dev qemu-utils busybox dialog curl sed
|
2024-05-05 06:13:00 +07:00
|
|
|
sudo snap install yq
|
|
|
|
|
2024-08-03 02:43:04 +07:00
|
|
|
df -h
|
|
|
|
|
2024-05-05 06:13:00 +07:00
|
|
|
# calculates the version number and push
|
|
|
|
- name: Calculate Version
|
|
|
|
run: |
|
|
|
|
# Calculate Version
|
2024-08-16 02:11:57 +07:00
|
|
|
VERSION="`date +'%y.%m'`.dev"
|
|
|
|
|
2024-05-05 06:13:00 +07:00
|
|
|
echo "Version: ${VERSION}"
|
|
|
|
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
|
|
|
|
2024-05-09 21:55:14 +07:00
|
|
|
# Get extractor, LKM, Addons, Modules, Theme and Configs
|
2024-10-24 23:59:15 +07:00
|
|
|
- name: Get Buildroot
|
2024-05-05 06:13:00 +07:00
|
|
|
run: |
|
|
|
|
. scripts/func.sh
|
|
|
|
|
2024-10-24 23:59:15 +07:00
|
|
|
echo "Get Dependencies"
|
2024-05-05 06:13:00 +07:00
|
|
|
getAddons "files/p3/addons"
|
|
|
|
getModules "files/p3/modules"
|
|
|
|
getConfigs "files/p3/configs"
|
|
|
|
getPatches "files/p3/patches"
|
2024-08-02 23:28:15 +07:00
|
|
|
getCustom "files/p3/custom"
|
2024-10-25 00:18:05 +07:00
|
|
|
getOffline "files/initrd/opt/arc/include"
|
2024-10-24 23:59:15 +07:00
|
|
|
getLKMs "files/p3/lkms"
|
2024-05-05 06:13:00 +07:00
|
|
|
getTheme "files/p1/boot/grub"
|
2024-10-24 23:59:15 +07:00
|
|
|
getBuildrootx "brx"
|
|
|
|
getBuildroots "brs"
|
|
|
|
|
2024-07-26 21:57:25 +07:00
|
|
|
echo "BUILD_TIME=$(date +'%Y-%m-%d %H:%M')" >> $GITHUB_ENV
|
2024-05-05 06:13:00 +07:00
|
|
|
|
|
|
|
echo "OK"
|
|
|
|
|
2024-08-16 20:47:38 +07:00
|
|
|
# Build incremental
|
2024-10-24 23:59:15 +07:00
|
|
|
- name: Build Next Image
|
2024-08-16 02:11:57 +07:00
|
|
|
run: |
|
|
|
|
. scripts/func.sh
|
|
|
|
|
2024-10-24 23:59:15 +07:00
|
|
|
# Modify Source File
|
|
|
|
echo "${VERSION}" >VERSION
|
|
|
|
echo "${VERSION}" >files/p1/ARC-VERSION
|
|
|
|
ARCBRANCH="dev"
|
|
|
|
echo "${ARCBRANCH}" >files/p1/ARC-BRANCH
|
|
|
|
echo "ARCBRANCH=${ARCBRANCH}" >> $GITHUB_ENV
|
2024-08-16 02:11:57 +07:00
|
|
|
|
|
|
|
echo "Create Arc Image"
|
2024-08-16 20:47:38 +07:00
|
|
|
IMAGE_FILE="arc.img"
|
2024-10-24 23:59:15 +07:00
|
|
|
gzip -dc "files/p3/image/grub.img.gz" >"${IMAGE_FILE}"
|
2024-08-16 02:11:57 +07:00
|
|
|
fdisk -l "${IMAGE_FILE}"
|
|
|
|
|
|
|
|
LOOPX=$(sudo losetup -f)
|
|
|
|
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
|
|
|
|
|
|
|
|
echo "Mounting Image File"
|
|
|
|
mkdir -p "/tmp/p1"
|
|
|
|
mkdir -p "/tmp/p3"
|
|
|
|
sudo mount ${LOOPX}p1 "/tmp/p1"
|
|
|
|
sudo mount ${LOOPX}p3 "/tmp/p3"
|
|
|
|
|
2024-10-24 23:59:15 +07:00
|
|
|
[ ! -f "brx/bzImage-arc" ] || [ ! -f "brx/initrd-arc" ] && return 1
|
2024-08-16 02:11:57 +07:00
|
|
|
|
|
|
|
echo "Repack initrd"
|
2024-10-24 23:59:15 +07:00
|
|
|
cp -f "brx/bzImage-arc" "files/p3/bzImage-arc"
|
|
|
|
cp -f "brx/initrd-arc" "files/p3/initrd-arc"
|
|
|
|
repackInitrd "brx/initrd-arc" "files/initrd" "files/p3/initrd-arc"
|
2024-08-16 02:11:57 +07:00
|
|
|
|
|
|
|
echo "Copying files"
|
|
|
|
sudo cp -Rf "files/p1/"* "/tmp/p1"
|
|
|
|
sudo cp -Rf "files/p3/"* "/tmp/p3"
|
|
|
|
sync
|
|
|
|
|
|
|
|
echo "Unmount image file"
|
|
|
|
sudo umount "/tmp/p1"
|
|
|
|
sudo umount "/tmp/p3"
|
|
|
|
rmdir "/tmp/p1"
|
|
|
|
rmdir "/tmp/p3"
|
|
|
|
|
|
|
|
sudo losetup --detach ${LOOPX}
|
|
|
|
|
|
|
|
echo "Image Converter"
|
2024-08-16 20:47:38 +07:00
|
|
|
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-dyn.vmdk
|
|
|
|
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc.vmdk
|
2024-10-24 23:59:15 +07:00
|
|
|
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc.vhdx
|
2024-08-16 02:11:57 +07:00
|
|
|
|
2024-10-24 23:59:15 +07:00
|
|
|
# Zip image and generate checksum
|
|
|
|
- name: Pack
|
|
|
|
run: |
|
|
|
|
if [ -n "${{ env.VERSION }}" ]; then
|
|
|
|
zip -9 "arc-${{ env.VERSION }}-next.img.zip" arc.img
|
|
|
|
zip -9 "arc-${{ env.VERSION }}-next.vmdk-dyn.zip" arc-dyn.vmdk
|
|
|
|
zip -9 "arc-${{ env.VERSION }}-next.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
|
|
|
zip -9 "arc-${{ env.VERSION }}-next.vhdx.zip" arc.vhdx
|
|
|
|
(cd files && zip -r ../update-${{ env.VERSION }}-next.zip .)
|
|
|
|
fi
|
2024-08-16 02:11:57 +07:00
|
|
|
|
2024-10-24 23:59:15 +07:00
|
|
|
# Cleanup
|
|
|
|
- name: Cleanup
|
|
|
|
run: |
|
|
|
|
rm -rf "arc.img" "arc.ova" "arc.vmdk" "arc-dyn.vmdk" "arc.vhdx" "arc-flat.vmdk"
|
|
|
|
|
|
|
|
# Build incremental
|
|
|
|
- name: Build Stable Image
|
2024-05-05 06:13:00 +07:00
|
|
|
run: |
|
|
|
|
. scripts/func.sh
|
|
|
|
|
2024-10-24 23:59:15 +07:00
|
|
|
ARCBRANCH="dev"
|
|
|
|
echo "${ARCBRANCH}" >files/p1/ARC-BRANCH
|
|
|
|
echo "ARCBRANCH=${ARCBRANCH}" >> $GITHUB_ENV
|
2024-07-26 21:57:25 +07:00
|
|
|
|
2024-05-05 06:13:00 +07:00
|
|
|
echo "Create Arc Image"
|
2024-10-24 23:59:15 +07:00
|
|
|
IMAGE_FILE="arc.img"
|
|
|
|
gzip -dc "files/p3/image/grub.img.gz" >"${IMAGE_FILE}"
|
2024-05-05 06:13:00 +07:00
|
|
|
fdisk -l "${IMAGE_FILE}"
|
|
|
|
|
|
|
|
LOOPX=$(sudo losetup -f)
|
|
|
|
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
|
|
|
|
|
2024-07-26 21:57:25 +07:00
|
|
|
echo "Mounting Image File"
|
2024-05-05 06:13:00 +07:00
|
|
|
mkdir -p "/tmp/p1"
|
|
|
|
mkdir -p "/tmp/p3"
|
|
|
|
sudo mount ${LOOPX}p1 "/tmp/p1"
|
|
|
|
sudo mount ${LOOPX}p3 "/tmp/p3"
|
|
|
|
|
2024-10-24 23:59:15 +07:00
|
|
|
[ ! -f "brs/bzImage-arc" ] || [ ! -f "brs/initrd-arc" ] && return 1
|
2024-05-05 06:13:00 +07:00
|
|
|
|
|
|
|
echo "Repack initrd"
|
2024-10-24 23:59:15 +07:00
|
|
|
cp -f "brs/bzImage-arc" "files/p3/bzImage-arc"
|
|
|
|
cp -f "brs/initrd-arc" "files/p3/initrd-arc"
|
|
|
|
# repackInitrd "brx/initrd-arc" "files/initrd" "files/p3/initrd-arc"
|
2024-05-05 06:13:00 +07:00
|
|
|
|
|
|
|
echo "Copying files"
|
|
|
|
sudo cp -Rf "files/p1/"* "/tmp/p1"
|
|
|
|
sudo cp -Rf "files/p3/"* "/tmp/p3"
|
|
|
|
sync
|
|
|
|
|
|
|
|
echo "Unmount image file"
|
|
|
|
sudo umount "/tmp/p1"
|
|
|
|
sudo umount "/tmp/p3"
|
|
|
|
rmdir "/tmp/p1"
|
|
|
|
rmdir "/tmp/p3"
|
|
|
|
|
|
|
|
sudo losetup --detach ${LOOPX}
|
|
|
|
|
2024-07-26 21:57:25 +07:00
|
|
|
echo "Image Converter"
|
2024-10-24 23:59:15 +07:00
|
|
|
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-dyn.vmdk
|
|
|
|
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc.vmdk
|
|
|
|
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc.vhdx
|
2024-07-26 21:57:25 +07:00
|
|
|
|
|
|
|
echo "Create Arc ova"
|
2024-10-24 23:59:15 +07:00
|
|
|
convertova "${IMAGE_FILE}" "arc.ova"
|
2024-07-26 21:57:25 +07:00
|
|
|
|
2024-05-05 06:13:00 +07:00
|
|
|
# Zip image and generate checksum
|
2024-10-24 23:59:15 +07:00
|
|
|
- name: Pack Stable Image
|
2024-05-05 06:13:00 +07:00
|
|
|
run: |
|
|
|
|
if [ -n "${{ env.VERSION }}" ]; then
|
2024-10-24 23:59:15 +07:00
|
|
|
zip -9 "arc-${{ env.VERSION }}-stable.img.zip" arc.img
|
|
|
|
zip -9 "arc-${{ env.VERSION }}-stable.vmdk-dyn.zip" arc-dyn.vmdk
|
|
|
|
zip -9 "arc-${{ env.VERSION }}-stable.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
|
|
|
zip -9 "arc-${{ env.VERSION }}-stable.vhdx.zip" arc.vhdx
|
|
|
|
zip -9 "arc-${{ env.VERSION }}-stable.ova.zip" arc.ova
|
|
|
|
(cd files && zip -r ../update-${{ env.VERSION }}-stable.zip .)
|
2024-05-05 06:13:00 +07:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Publish a release if is a tag
|
|
|
|
- name: Release
|
|
|
|
if: success() && env.VERSION != ''
|
|
|
|
uses: ncipollo/release-action@v1
|
|
|
|
with:
|
|
|
|
tag: ${{ env.VERSION }}
|
|
|
|
prerelease: true
|
2024-08-16 02:11:57 +07:00
|
|
|
makeLatest: false
|
2024-05-05 06:13:00 +07:00
|
|
|
allowUpdates: true
|
2024-07-26 21:57:25 +07:00
|
|
|
body: |
|
|
|
|
### Information:
|
2024-08-16 02:11:57 +07:00
|
|
|
Notice: Development Build
|
2024-07-26 21:57:25 +07:00
|
|
|
|
2024-10-24 23:59:15 +07:00
|
|
|
Full Changelog and Arc Patch (Decryption Key) are available in my Discord.
|
|
|
|
|
|
|
|
### Release
|
|
|
|
${{ env.BUILD_TIME }}
|
2024-05-05 06:13:00 +07:00
|
|
|
artifacts: |
|
2024-07-27 02:04:53 +07:00
|
|
|
arc-*.zip
|
2024-10-24 23:59:15 +07:00
|
|
|
update-*.zip
|