From 21ada277c25c9965349d4fac66143e27ba1db39d Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Fri, 5 Apr 2024 13:34:58 +0200 Subject: [PATCH] build: update Signed-off-by: AuxXxilium --- .github/workflows/autobuild.yml | 2 +- .github/workflows/build.yml | 10 +++++----- img-gen.sh | 5 ++++- scripts/func.sh | 5 +++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 190ba44d..2cd22f55 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -61,7 +61,7 @@ jobs: getLKMs "files/p3/lkms" getAddons "files/p3/addons" getModules "files/p3/modules" - getConfigs "files/p3/configs" + getConfigs "files/p3/configs" "${{ secrets.ACTION }}" getPatches "files/p3/patches" echo "OK" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a09274fa..6be32b69 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -121,19 +121,19 @@ jobs: getExtractor "files/p3/extractor" LKMTAG="${{ inputs.lkm_version }}" - getLKMs "files/p3/lkms" ${{ inputs.prerelease }} + getLKMs "files/p3/lkms" echo "LKMTAG=${TAG}" >> $GITHUB_ENV ADDONSTAG="${{ inputs.addons_version }}" - getAddons "files/p3/addons" ${{ inputs.prerelease }} + getAddons "files/p3/addons" echo "ADDONSTAG=${TAG}" >> $GITHUB_ENV MODULESTAG="${{ inputs.modules_version }}" - getModules "files/p3/modules" ${{ inputs.prerelease }} + getModules "files/p3/modules" echo "MODULESTAG=${TAG}" >> $GITHUB_ENV CONFIGSTAG="${{ inputs.configs_version }}" - getConfigs "files/p3/configs" ${{ inputs.prerelease }} + getConfigs "files/p3/configs" "${{ secrets.ACTION }}" echo "CONFIGSTAG=${TAG}" >> $GITHUB_ENV PATCHESTAG="${{ inputs.patches_version }}" - getPatches "files/p3/patches" ${{ inputs.prerelease }} + getPatches "files/p3/patches" echo "PATCHESTAG=${TAG}" >> $GITHUB_ENV echo "OK" diff --git a/img-gen.sh b/img-gen.sh index c9f4f6e5..8cf4c982 100755 --- a/img-gen.sh +++ b/img-gen.sh @@ -8,12 +8,15 @@ set -e sudo git clean -fdx sudo git pull +# Get Github Key +KEY="$(cat ../key)" + # Get extractor, LKM, addons and Modules getExtractor "files/p3/extractor" getLKMs "files/p3/lkms" getAddons "files/p3/addons" getModules "files/p3/modules" -getConfigs "files/p3/configs" +getConfigs "files/p3/configs" "${KEY}" getPatches "files/p3/patches" IMAGE_FILE="arc.img" diff --git a/scripts/func.sh b/scripts/func.sh index be4f3613..afad829b 100755 --- a/scripts/func.sh +++ b/scripts/func.sh @@ -136,13 +136,14 @@ function getConfigs() { echo "Getting Configs begin" local DEST_PATH="${1:-configs}" local CACHE_FILE="/tmp/configs.zip" + local KEY="${2:-${{ secrets.ACTION }}}" rm -f "${CACHE_FILE}" if [ -n "${CONFIGSTAG}" ]; then TAG="${CONFIGSTAG}" else - TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-configs/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')" + TAG="$(curl -s https://oauth2:${KEY}@api.github.com/repos/AuxXxilium/arc-configs/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')" fi - STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-configs/releases/download/${TAG}/configs.zip" -o "${CACHE_FILE}") + STATUS=$(curl -w "%{http_code}" -L "https://oauth2:${KEY}@github.com/AuxXxilium/arc-configs/releases/download/${TAG}/configs.zip" -o "${CACHE_FILE}") echo "TAG=${TAG}; Status=${STATUS}" [ ${STATUS} -ne 200 ] && exit 1 # Unzip Modules