Organizing for automation

This commit is contained in:
Fabio Belavenuto 2022-07-02 15:38:17 -03:00
parent 6d61c4dc7b
commit fb113ea435
4 changed files with 8 additions and 34 deletions

View File

@ -2,6 +2,10 @@ name: Build img
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
# push:
# pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
@ -31,7 +35,6 @@ jobs:
run: |
VERSION=`<VERSION`
echo "::set-output name=VERSION::$VERSION"
./compile-lkm.sh
./img-gen.sh
# Upload img

View File

@ -1,28 +0,0 @@
#!/usr/bin/env bash
set -e
TMP_PATH="/tmp"
DEST_PATH="files/board/arpl/p3/lkms"
###############################################################################
function trap_cancel() {
echo "Press Control+C once more terminate the process (or wait 2s for it to restart)"
sleep 2 || exit 1
}
trap trap_cancel SIGINT SIGTERM
###############################################################################
function die() {
echo -e "\033[1;31m$@\033[0m"
exit 1
}
# Main
while read PLATFORM KVER; do
# Compile using docker
docker run --rm -t --user `id -u` -v "${TMP_PATH}":/output \
-v "${PWD}/redpill-lkm":/input fbelavenuto/syno-compiler compile-lkm ${PLATFORM}
mv "${TMP_PATH}/redpill-dev.ko" "${DEST_PATH}/rp-${PLATFORM}-${KVER}-dev.ko"
mv "${TMP_PATH}/redpill-prod.ko" "${DEST_PATH}/rp-${PLATFORM}-${KVER}-prod.ko"
done < PLATFORMS

View File

@ -502,7 +502,6 @@ function addonMenu() {
;;
o) dialog --backtitle "`backtitle`" \
--inputbox "please enter the URL to download" 0 0 \
"https://raw.githubusercontent.com/fbelavenuto/arpl-addons/main/" \
2>${TMP_PATH}/resp
[ $? -ne 0 ] && continue
URL="`<"${TMP_PATH}/resp"`"

View File

@ -27,12 +27,12 @@ unzip /tmp/rp-lkms.zip -d files/board/arpl/p3/lkms
echo "Getting latest Addons"
TAG=`curl -s https://api.github.com/repos/fbelavenuto/arpl-addons/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'`
curl -L "https://github.com/fbelavenuto/arpl-addons/releases/download/${TAG}/addons.zip" -o /tmp/addons.zip
rm -rf addons
mkdir -p addons
unzip /tmp/addons.zip -d addons
rm -rf /tmp/addons
mkdir -p /tmp/addons
unzip /tmp/addons.zip -d /tmp/addons
DEST_PATH="files/board/arpl/p3/addons"
echo "Installing addons to ${DEST_PATH}"
for PKG in `ls addons/*.addon`; do
for PKG in `ls /tmp/addons/*.addon`; do
ADDON=`basename ${PKG} | sed 's|.addon||'`
mkdir -p "${DEST_PATH}/${ADDON}"
echo "Extracting ${PKG} to ${DEST_PATH}/${ADDON}"