2024-05-05 06:13:00 +07:00
|
|
|
#
|
2024-08-03 17:17:13 +07:00
|
|
|
# Copyright (C) 2023 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.
|
|
|
|
#
|
|
|
|
|
|
|
|
name: Build Arc
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
version:
|
2024-08-03 02:43:04 +07:00
|
|
|
description: "version"
|
2024-05-05 06:13:00 +07:00
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
notice:
|
|
|
|
description: "Notice here"
|
|
|
|
required: false
|
|
|
|
type: string
|
2024-07-17 21:20:14 +07:00
|
|
|
latest:
|
|
|
|
description: "latest"
|
|
|
|
default: true
|
|
|
|
type: boolean
|
2024-05-05 06:13:00 +07:00
|
|
|
prerelease:
|
|
|
|
description: "pre release"
|
|
|
|
default: false
|
|
|
|
type: boolean
|
|
|
|
clean:
|
|
|
|
description: "clean"
|
|
|
|
default: false
|
|
|
|
type: boolean
|
2024-07-17 21:17:22 +07:00
|
|
|
update_version:
|
|
|
|
description: "update min version"
|
2024-09-01 16:49:02 +07:00
|
|
|
default: "24.09.01"
|
2024-05-05 06:13:00 +07:00
|
|
|
type: string
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@main
|
|
|
|
|
2024-08-15 01:14:47 +07:00
|
|
|
- name: Delete releases and workflows runs
|
2024-05-05 06:13:00 +07:00
|
|
|
if: inputs.clean == true
|
2024-08-15 01:14:47 +07:00
|
|
|
uses: ophub/delete-releases-workflows@main
|
2024-05-05 06:13:00 +07:00
|
|
|
with:
|
2024-08-15 01:14:47 +07:00
|
|
|
delete_releases: true
|
|
|
|
releases_keep_latest: 1
|
|
|
|
delete_workflows: true
|
|
|
|
workflows_keep_day: 1
|
|
|
|
delete_tags: true
|
|
|
|
gh_token: ${{ secrets.GITHUB_TOKEN }}
|
2024-05-05 06:13:00 +07:00
|
|
|
|
|
|
|
- name: Free Disk Space (Ubuntu)
|
|
|
|
uses: jlumbroso/free-disk-space@main
|
|
|
|
with:
|
|
|
|
swap-storage: false
|
|
|
|
|
|
|
|
# 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
|
|
|
|
VERSION=""
|
|
|
|
if [ -n "${{ inputs.version }}" ]; then
|
|
|
|
VERSION="${{ inputs.version }}"
|
|
|
|
else
|
2024-07-17 21:20:14 +07:00
|
|
|
VERSION="`date +'%y.%m.%d'`"
|
2024-05-05 06:13:00 +07:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Version: ${VERSION}"
|
|
|
|
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
|
|
|
|
2024-05-09 21:55:14 +07:00
|
|
|
# Get extractor, LKM, Addons, Modules, Theme and Configs
|
|
|
|
- name: Get extractor, LKM, Addons, Modules, Theme and Configs
|
2024-05-05 06:13:00 +07:00
|
|
|
run: |
|
|
|
|
. scripts/func.sh
|
|
|
|
|
|
|
|
getLKMs "files/p3/lkms"
|
|
|
|
echo "LKMTAG=${TAG}" >> $GITHUB_ENV
|
|
|
|
getAddons "files/p3/addons"
|
|
|
|
echo "ADDONSTAG=${TAG}" >> $GITHUB_ENV
|
|
|
|
getModules "files/p3/modules"
|
|
|
|
echo "MODULESTAG=${TAG}" >> $GITHUB_ENV
|
|
|
|
getConfigs "files/p3/configs"
|
|
|
|
echo "CONFIGSTAG=${TAG}" >> $GITHUB_ENV
|
|
|
|
getPatches "files/p3/patches"
|
|
|
|
echo "PATCHESTAG=${TAG}" >> $GITHUB_ENV
|
2024-08-02 23:28:15 +07:00
|
|
|
getCustom "files/p3/custom"
|
|
|
|
echo "CUSTOMTAG=${TAG}" >> $GITHUB_ENV
|
2024-05-05 06:13:00 +07:00
|
|
|
getTheme "files/p1/boot/grub"
|
|
|
|
echo "THEMETAG=${TAG}" >> $GITHUB_ENV
|
2024-08-03 02:05:34 +07:00
|
|
|
getBuildrootx "latest" "brx"
|
2024-08-06 17:52:24 +07:00
|
|
|
echo "BRX_VERSION=${TAG}" >> $GITHUB_ENV
|
2024-08-03 02:05:34 +07:00
|
|
|
getBuildroots "latest" "brs"
|
2024-08-06 17:52:24 +07:00
|
|
|
echo "BRS_VERSION=${TAG}" >> $GITHUB_ENV
|
2024-05-09 21:55:14 +07:00
|
|
|
getOffline "files/p3/configs"
|
2024-06-23 16:24:22 +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
|
|
|
|
- name: Build Image S
|
2024-07-26 21:57:25 +07:00
|
|
|
run: |
|
|
|
|
. scripts/func.sh
|
|
|
|
|
2024-08-03 00:48:35 +07:00
|
|
|
if [ -n "${VERSION}" ]; then
|
|
|
|
# Modify Source File
|
|
|
|
echo "${VERSION}" >VERSION
|
|
|
|
echo "${VERSION}" >files/p1/ARC-VERSION
|
2024-08-16 20:47:38 +07:00
|
|
|
echo "stable" >files/p1/ARC-BRANCH
|
2024-08-03 00:48:35 +07:00
|
|
|
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
|
|
|
|
fi
|
|
|
|
|
2024-07-26 21:57:25 +07:00
|
|
|
echo "Create Arc Image"
|
2024-08-16 20:47:38 +07:00
|
|
|
IMAGE_FILE="arc.img"
|
2024-07-26 21:57:25 +07:00
|
|
|
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
|
|
|
|
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-08-16 20:47:38 +07:00
|
|
|
[ ! -f "brs/bzImage-arc" ] || [ ! -f "brs/initrd-arc" ] && return 1
|
2024-07-26 21:57:25 +07:00
|
|
|
|
|
|
|
echo "Repack initrd"
|
2024-08-16 20:47:38 +07:00
|
|
|
cp -f "brs/bzImage-arc" "files/p3/bzImage-arc"
|
|
|
|
repackInitrd "brs/initrd-arc" "files/initrd" "files/p3/initrd-arc"
|
2024-07-26 21:57:25 +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-07-26 21:57:25 +07:00
|
|
|
|
|
|
|
echo "Create Arc ova"
|
2024-08-16 20:47:38 +07:00
|
|
|
convertova "${IMAGE_FILE}" "arc.ova"
|
2024-07-26 21:57:25 +07:00
|
|
|
|
|
|
|
# Zip update and generate checksum
|
2024-08-16 20:47:38 +07:00
|
|
|
zip -9j update.zip "files/p3/bzImage-arc" "files/p3/initrd-arc" "files/p1/ARC-VERSION" "files/p1/boot/grub/grub.cfg"
|
|
|
|
sha256sum update.zip >checksum.sha256
|
2024-07-26 21:57:25 +07:00
|
|
|
|
2024-08-16 20:47:38 +07:00
|
|
|
# Build incremental
|
|
|
|
- name: Build Image X
|
2024-08-03 00:48:35 +07:00
|
|
|
run: |
|
|
|
|
. scripts/func.sh
|
|
|
|
|
|
|
|
if [ -n "${VERSION}" ]; then
|
|
|
|
# Modify Source File
|
|
|
|
echo "${VERSION}" >VERSION
|
|
|
|
echo "${VERSION}" >files/p1/ARC-VERSION
|
2024-08-16 20:47:38 +07:00
|
|
|
echo "next" >files/p1/ARC-BRANCH
|
2024-08-03 00:48:35 +07:00
|
|
|
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Create Arc Image"
|
2024-08-16 20:47:38 +07:00
|
|
|
IMAGE_FILE="arc-next.img"
|
2024-08-03 00:48:35 +07:00
|
|
|
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
|
|
|
|
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-08-16 20:47:38 +07:00
|
|
|
[ ! -f "brx/bzImage-arc" ] || [ ! -f "brx/initrd-arc" ] && return 1
|
2024-08-03 00:48:35 +07:00
|
|
|
|
|
|
|
echo "Repack initrd"
|
2024-08-16 20:47:38 +07:00
|
|
|
cp -f "brx/bzImage-arc" "files/p3/bzImage-arc"
|
|
|
|
repackInitrd "brx/initrd-arc" "files/initrd" "files/p3/initrd-arc"
|
2024-08-03 00:48:35 +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-next-dyn.vmdk
|
|
|
|
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc-next.vmdk
|
|
|
|
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc-next.vhdx
|
2024-08-03 00:48:35 +07:00
|
|
|
|
|
|
|
echo "Create Arc ova"
|
2024-08-16 20:47:38 +07:00
|
|
|
convertova "${IMAGE_FILE}" "arc-next.ova"
|
2024-08-03 00:48:35 +07:00
|
|
|
|
|
|
|
# Zip update and generate checksum
|
2024-08-16 20:47:38 +07:00
|
|
|
zip -9j update-next.zip "files/p3/bzImage-arc" "files/p3/initrd-arc" "files/p1/ARC-VERSION" "files/p1/boot/grub/grub.cfg"
|
|
|
|
sha256sum update-next.zip >checksum-next.sha256
|
2024-08-03 00:48:35 +07:00
|
|
|
|
2024-05-05 06:13:00 +07:00
|
|
|
# Zip image and generate checksum
|
|
|
|
- name: Pack
|
|
|
|
run: |
|
|
|
|
if [ -n "${{ env.VERSION }}" ]; then
|
2024-07-26 21:57:25 +07:00
|
|
|
# XBase
|
2024-08-08 01:34:00 +07:00
|
|
|
zip -9 "arc-${{ env.VERSION }}-next.img.zip" arc-next.img
|
|
|
|
zip -9 "arc-${{ env.VERSION }}-next.vmdk-dyn.zip" arc-next-dyn.vmdk
|
|
|
|
zip -9 "arc-${{ env.VERSION }}-next.vmdk-flat.zip" arc-next.vmdk arc-next-flat.vmdk
|
|
|
|
zip -9 "arc-${{ env.VERSION }}-next.vhdx.zip" arc-next.vhdx
|
|
|
|
zip -9 "arc-${{ env.VERSION }}-next.ova.zip" arc-next.ova
|
2024-08-06 17:52:24 +07:00
|
|
|
# SBase
|
2024-07-27 04:18:48 +07:00
|
|
|
zip -9 "arc-${{ env.VERSION }}.img.zip" arc.img
|
|
|
|
zip -9 "arc-${{ env.VERSION }}.vmdk-dyn.zip" arc-dyn.vmdk
|
|
|
|
zip -9 "arc-${{ env.VERSION }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
|
|
|
zip -9 "arc-${{ env.VERSION }}.ova.zip" arc.ova
|
2024-05-05 06:13:00 +07:00
|
|
|
fi
|
2024-07-17 21:17:22 +07:00
|
|
|
echo "${{ inputs.update_version }}" >check.update
|
2024-05-05 06:13:00 +07:00
|
|
|
|
|
|
|
# Publish a release if is a tag
|
|
|
|
- name: Release
|
|
|
|
if: success() && env.VERSION != ''
|
|
|
|
uses: ncipollo/release-action@v1
|
|
|
|
with:
|
|
|
|
tag: ${{ env.VERSION }}
|
|
|
|
prerelease: ${{ inputs.prerelease }}
|
2024-07-17 21:20:14 +07:00
|
|
|
makeLatest: ${{ inputs.latest }}
|
2024-05-05 06:13:00 +07:00
|
|
|
allowUpdates: true
|
|
|
|
body: |
|
2024-06-28 20:08:14 +07:00
|
|
|
### Information:
|
|
|
|
Notice: ${{ inputs.notice }}
|
2024-07-26 21:57:25 +07:00
|
|
|
|
2024-08-03 00:48:35 +07:00
|
|
|
- Version:
|
2024-08-06 17:52:24 +07:00
|
|
|
- arc: Stable Buildroot System (Less Hardware supported / faster Boot)
|
2024-08-09 21:00:41 +07:00
|
|
|
- arc-next: Latest Buildroot System (More Hardware supported (still in testing))
|
2024-08-16 02:11:57 +07:00
|
|
|
- Full Changelog and Arc Patch (Decryption Key) are available in my Discord.
|
2024-06-23 16:24:22 +07:00
|
|
|
|
2024-05-18 17:33:37 +07:00
|
|
|
### Versions:
|
2024-05-05 06:13:00 +07:00
|
|
|
Addons: ${{ env.ADDONSTAG }}
|
|
|
|
Configs: ${{ env.CONFIGSTAG }}
|
|
|
|
Modules: ${{ env.MODULESTAG }}
|
|
|
|
Patches: ${{ env.PATCHESTAG }}
|
2024-08-02 23:28:15 +07:00
|
|
|
Custom: ${{ env.CUSTOMTAG }}
|
2024-05-05 06:13:00 +07:00
|
|
|
Theme: ${{ env.THEMETAG }}
|
|
|
|
LKM: ${{ env.LKMTAG }}
|
2024-08-06 17:52:24 +07:00
|
|
|
Buildroot: ${{ env.BRS_VERSION }} | Buildroot Next: ${{ env.BRX_VERSION }}
|
2024-08-08 20:17:01 +07:00
|
|
|
Release: ${{ env.BUILD_TIME }}
|
2024-05-05 06:13:00 +07:00
|
|
|
artifacts: |
|
2024-07-27 02:04:53 +07:00
|
|
|
arc-*.zip
|
2024-07-27 04:18:48 +07:00
|
|
|
update.zip
|
2024-08-06 17:52:24 +07:00
|
|
|
update-next.zip
|
2024-07-27 04:18:48 +07:00
|
|
|
checksum.sha256
|
2024-08-06 17:52:24 +07:00
|
|
|
checksum-next.sha256
|
2024-07-17 21:17:22 +07:00
|
|
|
check.update
|