From 6d3382026c1b5a5cdea195b97e3d9edcb6d147ce Mon Sep 17 00:00:00 2001 From: Paul Kendall Date: Thu, 7 Sep 2023 10:11:51 +1200 Subject: [PATCH] Auto generate valid versions from artefact repository --- .github/workflows/web.yml | 5 ++++- src/js/index.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml index 65af696..7d0195a 100644 --- a/.github/workflows/web.yml +++ b/.github/workflows/web.yml @@ -33,14 +33,17 @@ jobs: mkdir firmware cd firmware curl -L -o index.json https://artifactory.expresslrs.org/ExpressLRS/index.json - for i in 3.0.0 3.0.1 3.1.0 3.1.1 3.1.2 3.2.0 3.2.1 3.3.0 ; do + for i in `cat index.json | jq '.tags | keys[]' | grep -v -- -RC | sed 's/"//g' | sort -r` ; do HASH=`grep \"$i\" index.json | sed 's/.* "//' | sed 's/".*//'` curl -L -o firmware.zip "https://artifactory.expresslrs.org/ExpressLRS/$HASH/firmware.zip" unzip firmware.zip rm firmware.zip mv firmware $i + VERSIONS=$VERSIONS", '$i'" done rm -f index.json + VERSIONS=`echo $VERSIONS|sed 's/, //'` + sed -i~ "s/\"@VERSIONS@\"/$VERSIONS/" ../main*.js - name: Setup Pages if: ${{ github.ref == 'refs/heads/master' }} uses: actions/configure-pages@v1 diff --git a/src/js/index.js b/src/js/index.js index 6c95ebb..a015ecd 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -8,7 +8,7 @@ import { SwalMUI, Toast } from './swalmui.js' import FileSaver from 'file-saver' import mui from 'muicss' -const versions = ['3.3.0', '3.2.1', '3.2.0', '3.1.2', '3.1.1', '3.1.0', '3.0.1', '3.0.0'] +const versions = ['@VERSIONS@'] const versionSelect = _('version') const flashMode = _('flash-mode') const flashButton = _('flashButton')