arc/.github/workflows/build.yml
AuxXxilium 91b26d3556 build: set stable br
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-07-17 16:31:12 +02:00

263 lines
8.8 KiB
YAML

#
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium> and Ing <https://github.com/wjz304>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
name: Build Arc
on:
workflow_dispatch:
inputs:
version:
description: "format %y.%m.$d or auto"
required: false
type: string
notice:
description: "Notice here"
required: false
type: string
latest:
description: "latest"
default: true
type: boolean
prerelease:
description: "pre release"
default: false
type: boolean
clean:
description: "clean"
default: false
type: boolean
update_version:
description: "update min version"
default: "24.07.12"
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Clean Old
if: inputs.clean == true
uses: Nats-ji/delete-old-releases@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
keep-count: 10
keep-old-minor-releases: false
- 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
sudo apt install -y jq gawk cpio gettext libelf-dev qemu-utils busybox dialog curl sed
sudo snap install yq
# calculates the version number and push
- name: Calculate Version
run: |
# Calculate Version
VERSION=""
if [ -n "${{ inputs.version }}" ]; then
VERSION="${{ inputs.version }}"
else
VERSION="`date +'%y.%m.%d'`"
fi
echo "Version: ${VERSION}"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
if [ -n "${VERSION}" ]; then
# Modify Source File
echo "${VERSION}" >VERSION
echo "${VERSION}" >files/p1/ARC-VERSION
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
fi
# Get extractor, LKM, Addons, Modules, Theme and Configs
- name: Get extractor, LKM, Addons, Modules, Theme and Configs
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
getTheme "files/p1/boot/grub"
echo "THEMETAG=${TAG}" >> $GITHUB_ENV
getOffline "files/p3/configs"
getBuildroot "latest" "br"
echo "BR_VERSION=${TAG}" >> $GITHUB_ENV
echo "BUILD_TIME=$(date +'%Y-%m-%d %H:%M')" >> $GITHUB_ENV
echo "OK"
# Build incremental
- name: Build Image New
run: |
. scripts/func.sh
echo "Create Arc Image"
IMAGE_FILE="arc.img"
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"
[ ! -f "br/bzImage-arc" ] || [ ! -f "br/initrd-arc" ] && return 1
echo "Repack initrd"
cp -f "br/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "br/initrd-arc" "files/initrd" "files/p3/initrd-arc"
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"
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,compat6 arc-dyn.vmdk
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat,compat6 arc.vmdk
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc.vhdx
echo "Create Arc ova"
convertova "arc.img" "arc.ova"
# Build incremental
- name: Build Image Stable
run: |
. scripts/func.sh
echo "${VERSION}s" >files/p1/ARC-VERSION
TAG="24.07.0" # Stable Buildroot Version
echo "BR_STABLE_VERSION=${TAG}" >> $GITHUB_ENV
getBuildroot "${TAG}" "stable_br"
echo "Create Arc Image"
IMAGE_FILE="arc-sbase.img"
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"
[ ! -f "stable_br/bzImage-arc" ] || [ ! -f "stable_br/initrd-arc" ] && return 1
echo "Repack initrd"
cp -f "stable_br/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "stable_br/initrd-arc" "files/initrd" "files/p3/initrd-arc"
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"
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,compat6 arc-sbase-dyn.vmdk
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat,compat6 arc-sbase.vmdk
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc-sbase.vhdx
echo "Create Arc ova"
convertova "${IMAGE_FILE}" "arc-sbase.ova"
# Zip image and generate checksum
- name: Pack
run: |
if [ -n "${{ env.VERSION }}" ]; then
# NBase
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 }}.vhdx.zip" arc.vhdx
zip -9 "arc-${{ env.VERSION }}.ova.zip" arc.ova
# SBase
zip -9 "arc-sbase-${{ env.VERSION }}.img.zip" arc-sbase.img
zip -9 "arc-sbase-${{ env.VERSION }}.vmdk-dyn.zip" arc-sbase-dyn.vmdk
zip -9 "arc-sbase-${{ env.VERSION }}.vmdk-flat.zip" arc-sbase.vmdk arc-sbase-flat.vmdk
zip -9 "arc-sbase-${{ env.VERSION }}.vhdx.zip" arc-sbase.vhdx
zip -9 "arc-sbase-${{ env.VERSION }}.ova.zip" arc-sbase.ova
fi
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
echo "${{ inputs.update_version }}" >check.update
# 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 }}
makeLatest: ${{ inputs.latest }}
allowUpdates: true
body: |
### Information:
Notice: ${{ inputs.notice }}
Buildtime: ${{ env.BUILD_TIME }}
Versions:
arc-${{ env.VERSION }} includes the latest Buildroot. (Latest Hardware Support)
arc-sbase-${{ env.VERSION }} includes the stable Buildroot. (Better Compatibility)
Full Changelog and Arc Patch (Decryption Key) can be found in my Discord.
### Versions:
Addons: ${{ env.ADDONSTAG }}
Configs: ${{ env.CONFIGSTAG }}
Modules: ${{ env.MODULESTAG }}
Patches: ${{ env.PATCHESTAG }}
Theme: ${{ env.THEMETAG }}
LKM: ${{ env.LKMTAG }}
Buildroot: ${{ env.BR_VERSION }} | Stable: ${{ env.BR_STABLE_VERSION }}
artifacts: |
arc-*.zip
update.zip
checksum.sha256
check.update