From 61ba324ca09679e15fe1fbc5015a1008e390722e Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Wed, 6 Nov 2024 10:52:26 -0500 Subject: [PATCH] fix: variables passed properly --- .github/workflows/main.yml | 14 +++-- plugin/plugins/dynamix.unraid.net.plg | 81 ++++++++++++++------------- 2 files changed, 52 insertions(+), 43 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 495b1377b..2ee30f255 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -164,6 +164,7 @@ jobs: name: unraid-web path: ./plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/unraid-components - name: Download Node.js From Slackbuilds + id: download-nodejs run: | # Get latest node version (based on main_node_version) from slackware main_node_version=$(sed 's/^v//' ../api/.nvmrc) @@ -179,7 +180,10 @@ jobs: exit 1 fi node_sha256=$(sha256sum "${{ github.workspace }}/plugin/archive/${latest_nodejs}" | cut -f 1 -d ' ') + echo "NODEJS_FILENAME=${latest_nodejs}" >> $GITHUB_OUTPUT + echo "NODEJS_SHA256=${node_sha256}" >> $GITHUB_OUTPUT - name: Download nghttp3 + id: download-nghttp3 run: | # Get latest nghttp3 version base_nghttp3_url="https://mirrors.slackware.com/slackware/slackware64-current/slackware64/n/" @@ -190,16 +194,18 @@ jobs: exit 1 fi nghttp3_sha256=$(sha256sum "${{ github.workspace }}/plugin/archive/${latest_nghttp3}" | cut -f 1 -d ' ') + echo "NGHTTP3_FILENAME=${latest_nghttp3}" >> $GITHUB_OUTPUT + echo "NGHTTP3_SHA256=${nghttp3_sha256}" >> $GITHUB_OUTPUT - name: Build Plugin run: | cd source/dynamix.unraid.net export API_VERSION=${{needs.build-test-api.outputs.API_VERSION}} export API_MD5=${{needs.build-test-api.outputs.API_MD5}} export API_SHA256=${{needs.build-test-api.outputs.API_SHA256}} - export NODEJS_FILENAME=${latest_nodejs} - export NODEJS_SHA256=${node_sha256} - export NGHTTP3_FILENAME=${latest_nghttp3} - export NGHTTP3_SHA256=${nghttp3_sha256} + export NODEJS_FILENAME=${{ steps.download-nodejs.outputs.NODEJS_FILENAME }} + export NODEJS_SHA256=${{ steps.download-nodejs.outputs.NODEJS_SHA256 }} + export NGHTTP3_FILENAME=${{ steps.download-nghttp3.outputs.NGHTTP3_FILENAME }} + export NGHTTP3_SHA256=${{ steps.download-nghttp3.outputs.NGHTTP3_SHA256 }} bash ./pkg_build.sh s ${{github.event.pull_request.number}} bash ./pkg_build.sh p - name: Upload binary txz and plg to Github artifacts diff --git a/plugin/plugins/dynamix.unraid.net.plg b/plugin/plugins/dynamix.unraid.net.plg index 2943958ce..8e3195c57 100755 --- a/plugin/plugins/dynamix.unraid.net.plg +++ b/plugin/plugins/dynamix.unraid.net.plg @@ -1,38 +1,38 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + ]> - + -##a long time ago in a galaxy far far away -- initial release + ##a long time ago in a galaxy far far away + - initial release -name="&name;" version="&version;" API_version="&API_version;" PLGTYPE="&env;" - /dev/null; then - echo "⚠️ Warning: Your DNS server (${DNS_SERVER1}) is unable to resolve '${HOST}'" + echo "⚠️ Warning: Your DNS server (${DNS_SERVER1}) is unable to resolve '${HOST}'" DNSERR=yes fi } @@ -91,7 +91,8 @@ sha256check() { FILE=$1 EXPECTED=$2 if [[ -f "${FILE}" ]]; then - echo -n "Validating ${FILE}... " ACTUAL=$(sha256sum "${FILE}" 2>/dev/null | grep -Po '^\S+') + echo -n "Validating ${FILE}... " + ACTUAL=$(sha256sum "${FILE}" 2>/dev/null | grep -Po '^\S+') if [[ "$EXPECTED" != "$ACTUAL" ]]; then rm "${FILE}" echo " old. Deleted file." @@ -101,20 +102,22 @@ sha256check() { fi } ]]> -sha256check "&source;.txz" "&SHA256;" -sha256check "/boot/config/plugins/dynamix.my.servers/unraid-api.tgz" "&API_SHA256;" -exit 0 + sha256check "&source;.txz" "&SHA256;" + sha256check "/boot/config/plugins/dynamix.my.servers/unraid-api.tgz" "&API_SHA256;" + exit 0 - - &NODE_TXZ; - &NODE_SHA256; + + &NODEJS_TXZ; + &NODEJS_SHA256; - + &NGHTTP3_TXZ; &NGHTTP3_SHA256; @@ -133,8 +136,8 @@ exit 0 -MAINTXZ="&source;.txz" - -MAINNAME="&name;" - -PLGTYPE="&env;" MAINTXZ="&source;.txz" - /dev/null; then