mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
Merge pull request #518 from fbelavenuto/gaction
Little improvement into github actions
This commit is contained in:
commit
bad5e9cf70
48
.github/workflows/main.yml
vendored
48
.github/workflows/main.yml
vendored
@ -22,13 +22,40 @@ jobs:
|
||||
path: .buildroot
|
||||
key: ${{ runner.os }}-${{ hashFiles('files/configs/arpl_defconfig') }}
|
||||
|
||||
# Install dependencies
|
||||
# Install dependencies
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libelf-dev qemu-utils
|
||||
sudo cp -f files/board/arpl/overlayfs/usr/bin/yq /usr/bin/yq
|
||||
|
||||
# Get latests LKM, addons and modules
|
||||
- name: Get latests LKM, addons and Modules
|
||||
run: |
|
||||
# Get latest LKMs
|
||||
echo "Getting latest LKMs"
|
||||
TAG=`curl -s https://api.github.com/repos/fbelavenuto/redpill-lkm/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'`
|
||||
STATUS=`curl -w "%{http_code}" -L "https://github.com/fbelavenuto/redpill-lkm/releases/download/${TAG}/rp-lkms.zip" -o /tmp/rp-lkms.zip`
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
|
||||
# Get latest addons and install its
|
||||
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)}'`
|
||||
STATUS=`curl -w "%{http_code}" -L "https://github.com/fbelavenuto/arpl-addons/releases/download/${TAG}/addons.zip" -o /tmp/addons.zip`
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
|
||||
# Get latest modules
|
||||
echo "Getting latest modules"
|
||||
MODULES_DIR="files/board/arpl/p3/modules"
|
||||
TAG=`curl -s https://api.github.com/repos/fbelavenuto/arpl-modules/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'`
|
||||
while read PLATFORM KVER; do
|
||||
FILE="${PLATFORM}-${KVER}"
|
||||
STATUS=`curl -L "https://github.com/fbelavenuto/arpl-modules/releases/download/${TAG}/${FILE}.tgz" -o "${MODULES_DIR}/${FILE}.tgz"`
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
done < PLATFORMS
|
||||
STATUS=`curl -L "https://github.com/fbelavenuto/arpl-modules/releases/download/${TAG}/firmware.tgz" -o "${MODULES_DIR}/firmware.tgz"`
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
|
||||
# Prepare buildroot for first make (for cache)
|
||||
- name: Prepare buildroot
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
@ -54,16 +81,10 @@ jobs:
|
||||
rm -rf .buildroot/board/arpl/overlayfs
|
||||
rm -rf .buildroot/board/arpl/p1
|
||||
rm -rf .buildroot/board/arpl/p3
|
||||
# Get latest LKMs
|
||||
echo "Getting latest LKMs"
|
||||
TAG=`curl -s https://api.github.com/repos/fbelavenuto/redpill-lkm/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'`
|
||||
curl -L "https://github.com/fbelavenuto/redpill-lkm/releases/download/${TAG}/rp-lkms.zip" -o /tmp/rp-lkms.zip
|
||||
# Unzip LKMs
|
||||
rm -rf files/board/arpl/p3/lkms/*
|
||||
unzip /tmp/rp-lkms.zip -d files/board/arpl/p3/lkms
|
||||
# Get latest addons and install its
|
||||
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
|
||||
# Install Addons
|
||||
mkdir -p /tmp/addons
|
||||
unzip /tmp/addons.zip -d /tmp/addons
|
||||
DEST_PATH="files/board/arpl/p3/addons"
|
||||
@ -74,15 +95,6 @@ jobs:
|
||||
echo "Extracting ${PKG} to ${DEST_PATH}/${ADDON}"
|
||||
tar xaf "${PKG}" -C "${DEST_PATH}/${ADDON}"
|
||||
done
|
||||
# Get latest modules
|
||||
echo "Getting latest modules"
|
||||
MODULES_DIR="files/board/arpl/p3/modules"
|
||||
TAG=`curl -s https://api.github.com/repos/fbelavenuto/arpl-modules/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'`
|
||||
while read PLATFORM KVER; do
|
||||
FILE="${PLATFORM}-${KVER}"
|
||||
curl -L "https://github.com/fbelavenuto/arpl-modules/releases/download/${TAG}/${FILE}.tgz" -o "${MODULES_DIR}/${FILE}.tgz"
|
||||
done < PLATFORMS
|
||||
curl -L "https://github.com/fbelavenuto/arpl-modules/releases/download/${TAG}/firmware.tgz" -o "${MODULES_DIR}/firmware.tgz"
|
||||
# Copy files
|
||||
echo "Copying files"
|
||||
sed 's/^ARPL_VERSION=.*/ARPL_VERSION="'${VERSION}'"/' -i files/board/arpl/overlayfs/opt/arpl/include/consts.sh
|
||||
|
Loading…
x
Reference in New Issue
Block a user