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 Image
|
2024-05-05 06:13:00 +07:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
2024-11-09 23:43:20 +07:00
|
|
|
runs:
|
|
|
|
description: "runs-on (ubuntu-latest / self-hosted)"
|
2024-11-09 23:45:40 +07:00
|
|
|
type: choice
|
|
|
|
options:
|
|
|
|
- ubuntu-latest
|
|
|
|
- self-hosted
|
2024-05-05 06:13:00 +07:00
|
|
|
version:
|
2024-11-08 02:24:20 +07:00
|
|
|
description: "version (1.0.0)"
|
|
|
|
required: true
|
2024-05-05 06:13:00 +07:00
|
|
|
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
|
2024-10-24 23:59:15 +07:00
|
|
|
next:
|
|
|
|
description: "next"
|
|
|
|
default: true
|
|
|
|
type: boolean
|
|
|
|
stable:
|
|
|
|
description: "stable"
|
|
|
|
default: true
|
|
|
|
type: boolean
|
2024-05-05 06:13:00 +07:00
|
|
|
clean:
|
|
|
|
description: "clean"
|
|
|
|
default: false
|
|
|
|
type: boolean
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2024-11-09 23:43:20 +07:00
|
|
|
runs-on: ${{ inputs.runs }}
|
2024-05-05 06:13:00 +07:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@main
|
|
|
|
|
2024-08-15 01:14:47 +07:00
|
|
|
- name: Delete releases and workflows runs
|
2024-11-09 23:45:40 +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
|
2024-11-09 23:45:40 +07:00
|
|
|
delete_workflows: false
|
2024-08-15 01:14:47 +07:00
|
|
|
delete_tags: true
|
|
|
|
gh_token: ${{ secrets.GITHUB_TOKEN }}
|
2024-05-05 06:13:00 +07:00
|
|
|
|
|
|
|
# Install Dependencies
|
|
|
|
- name: Install Dependencies
|
2024-11-10 06:56:17 +07:00
|
|
|
if: ${{ github.event.inputs.runs == 'ubuntu-latest' }}
|
2024-05-05 06:13:00 +07:00
|
|
|
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-09 21:55:14 +07:00
|
|
|
# Get extractor, LKM, Addons, Modules, Theme and Configs
|
2024-10-24 23:59:15 +07:00
|
|
|
- name: Get Dependencies for all Image
|
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-31 02:02:17 +07:00
|
|
|
getOffline "files/p3/configs"
|
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-11-09 18:22:54 +07:00
|
|
|
# Export Dependencies Version to env
|
|
|
|
echo "ADDONTAG=${ADDONTAG}" >> $GITHUB_ENV
|
|
|
|
echo "MODULETAG=${MODULETAG}" >> $GITHUB_ENV
|
|
|
|
echo "CONFIGTAG=${CONFIGTAG}" >> $GITHUB_ENV
|
|
|
|
echo "PATCHTAG=${PATCHTAG}" >> $GITHUB_ENV
|
|
|
|
echo "CUSTOMTAG=${CUSTOMTAG}" >> $GITHUB_ENV
|
|
|
|
echo "LKMTAG=${LKMTAG}" >> $GITHUB_ENV
|
|
|
|
echo "THEMETAG=${THEMETAG}" >> $GITHUB_ENV
|
|
|
|
echo "BRXTAG=${BRXTAG}" >> $GITHUB_ENV
|
|
|
|
echo "BRSTAG=${BRSTAG}" >> $GITHUB_ENV
|
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
|
2024-10-24 23:59:15 +07:00
|
|
|
- name: Build Next Image
|
|
|
|
if: inputs.next == true
|
2024-07-26 21:57:25 +07:00
|
|
|
run: |
|
|
|
|
. scripts/func.sh
|
|
|
|
|
2024-11-08 02:24:20 +07:00
|
|
|
# Modify Source File
|
2024-11-09 01:44:29 +07:00
|
|
|
ARC_BUILD="`date +'%y%m%d'`"
|
2024-11-08 02:24:20 +07:00
|
|
|
ARC_VERSION="${{ inputs.version }}"
|
|
|
|
ARC_BRANCH="next"
|
|
|
|
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
|
|
|
|
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
|
|
|
|
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
|
|
|
|
echo "ARC_BUILD=${ARC_BUILD}" >> $GITHUB_ENV
|
|
|
|
echo "ARC_VERSION=${ARC_VERSION}" >> $GITHUB_ENV
|
|
|
|
echo "ARC_BRANCH=${ARC_BRANCH}" >> $GITHUB_ENV
|
2024-08-03 00:48:35 +07:00
|
|
|
|
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-10-24 23:59:15 +07:00
|
|
|
[ ! -f "brx/bzImage-arc" ] || [ ! -f "brx/initrd-arc" ] && return 1
|
2024-07-26 21:57:25 +07:00
|
|
|
|
|
|
|
echo "Repack initrd"
|
2024-10-24 23:59:15 +07:00
|
|
|
cp -f "brx/bzImage-arc" "files/p3/bzImage-arc"
|
2024-10-25 13:48:49 +07:00
|
|
|
#cp -f "brx/initrd-arc" "files/p3/initrd-arc"
|
2024-10-24 23:59:15 +07:00
|
|
|
repackInitrd "brx/initrd-arc" "files/initrd" "files/p3/initrd-arc"
|
2024-07-26 21:57:25 +07:00
|
|
|
|
|
|
|
echo "Copying files"
|
2024-11-09 23:45:40 +07:00
|
|
|
sudo cp -rf "files/p1/"* "/tmp/p1"
|
|
|
|
sudo cp -rf "files/p3/"* "/tmp/p3"
|
2024-11-10 06:56:17 +07:00
|
|
|
sudo sync
|
2024-07-26 21:57:25 +07:00
|
|
|
|
|
|
|
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-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
|
|
|
|
2024-10-24 23:59:15 +07:00
|
|
|
# Zip image and generate checksum
|
|
|
|
- name: Pack Next Image
|
|
|
|
if: inputs.next == true
|
|
|
|
run: |
|
2024-11-08 02:24:20 +07:00
|
|
|
if [ -n "${{ env.ARC_VERSION }}" ]; then
|
|
|
|
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.img.zip" arc.img
|
|
|
|
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-dyn.zip" arc-dyn.vmdk
|
|
|
|
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
|
|
|
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vhdx.zip" arc.vhdx
|
|
|
|
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.ova.zip" arc.ova
|
|
|
|
(cd files && zip -r ../update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.zip ./p1 ./p3)
|
2024-10-24 23:59:15 +07:00
|
|
|
fi
|
|
|
|
|
|
|
|
# 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
|
|
|
|
if: inputs.stable == true
|
2024-08-03 00:48:35 +07:00
|
|
|
run: |
|
|
|
|
. scripts/func.sh
|
|
|
|
|
2024-11-08 02:24:20 +07:00
|
|
|
# Modify Source File
|
2024-11-09 01:44:29 +07:00
|
|
|
ARC_BUILD="`date +'%y%m%d'`"
|
2024-11-08 02:24:20 +07:00
|
|
|
ARC_VERSION="${{ inputs.version }}"
|
|
|
|
ARC_BRANCH="stable"
|
|
|
|
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
|
|
|
|
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
|
|
|
|
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
|
|
|
|
echo "ARC_BUILD=${ARC_BUILD}" >> $GITHUB_ENV
|
|
|
|
echo "ARC_VERSION=${ARC_VERSION}" >> $GITHUB_ENV
|
|
|
|
echo "ARC_BRANCH=${ARC_BRANCH}" >> $GITHUB_ENV
|
2024-08-03 00:48:35 +07:00
|
|
|
|
|
|
|
echo "Create Arc Image"
|
2024-10-24 23:59:15 +07:00
|
|
|
IMAGE_FILE="arc.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-10-24 23:59:15 +07:00
|
|
|
[ ! -f "brs/bzImage-arc" ] || [ ! -f "brs/initrd-arc" ] && return 1
|
2024-08-03 00:48:35 +07:00
|
|
|
|
|
|
|
echo "Repack initrd"
|
2024-10-24 23:59:15 +07:00
|
|
|
cp -f "brs/bzImage-arc" "files/p3/bzImage-arc"
|
2024-10-25 13:48:49 +07:00
|
|
|
#cp -f "brs/initrd-arc" "files/p3/initrd-arc"
|
2024-10-24 23:59:15 +07:00
|
|
|
repackInitrd "brs/initrd-arc" "files/initrd" "files/p3/initrd-arc"
|
2024-08-03 00:48:35 +07:00
|
|
|
|
|
|
|
echo "Copying files"
|
2024-11-10 06:56:17 +07:00
|
|
|
sudo cp -rf "files/p1/"* "/tmp/p1"
|
|
|
|
sudo cp -rf "files/p3/"* "/tmp/p3"
|
|
|
|
sudo sync
|
2024-08-03 00:48:35 +07:00
|
|
|
|
|
|
|
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-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-08-03 00:48:35 +07:00
|
|
|
|
|
|
|
echo "Create Arc ova"
|
2024-10-24 23:59:15 +07:00
|
|
|
convertova "${IMAGE_FILE}" "arc.ova"
|
2024-08-03 00:48:35 +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
|
|
|
|
if: inputs.stable == true
|
2024-05-05 06:13:00 +07:00
|
|
|
run: |
|
2024-11-08 02:24:20 +07:00
|
|
|
if [ -n "${{ env.ARC_VERSION }}" ]; then
|
|
|
|
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.img.zip" arc.img
|
|
|
|
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-dyn.zip" arc-dyn.vmdk
|
|
|
|
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
|
|
|
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vhdx.zip" arc.vhdx
|
|
|
|
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.ova.zip" arc.ova
|
|
|
|
(cd files && zip -r ../update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.zip ./p1 ./p3)
|
2024-05-05 06:13:00 +07:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Publish a release if is a tag
|
|
|
|
- name: Release
|
2024-11-08 02:24:20 +07:00
|
|
|
if: success() && env.ARC_VERSION != ''
|
2024-05-05 06:13:00 +07:00
|
|
|
uses: ncipollo/release-action@v1
|
|
|
|
with:
|
2024-11-10 17:08:35 +07:00
|
|
|
tag: ${{ env.ARC_VERSION }}
|
2024-05-05 06:13:00 +07:00
|
|
|
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-11-10 17:08:35 +07:00
|
|
|
### Note:
|
2024-11-10 06:56:17 +07:00
|
|
|
- ${{ inputs.notice }}
|
|
|
|
|
2024-06-28 20:08:14 +07:00
|
|
|
### Information:
|
2024-11-10 06:56:17 +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-11-08 02:24:20 +07:00
|
|
|
- stable: Stable Image (Full Image, all dependencies are included, less hardware support)
|
|
|
|
- next: Next Image (Full Image, all dependencies are included, more hardware support, new features to test)
|
2024-10-24 23:59:15 +07:00
|
|
|
|
2024-11-09 18:22:54 +07:00
|
|
|
### Dependencies:
|
|
|
|
- Addons: ${{ env.ADDONTAG }}
|
|
|
|
- Modules: ${{ env.MODULETAG }}
|
|
|
|
- Configs: ${{ env.CONFIGTAG }}
|
|
|
|
- Patches: ${{ env.PATCHTAG }}
|
|
|
|
- Custom: ${{ env.CUSTOMTAG }}
|
|
|
|
- LKMs: ${{ env.LKMTAG }}
|
|
|
|
- Buildroot Stable: ${{ env.BRSTAG }}
|
2024-11-10 17:08:35 +07:00
|
|
|
- Buildroot Next: ${{ env.BRXTAG }}
|
2024-11-09 18:22:54 +07:00
|
|
|
|
2024-10-24 23:59:15 +07:00
|
|
|
### Release
|
2024-11-10 06:56:17 +07:00
|
|
|
- ${{ 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
|