Skip to content

Commit

Permalink
Auto generate valid versions from artefact repository
Browse files Browse the repository at this point in the history
  • Loading branch information
pkendall64 committed Sep 6, 2023
1 parent 632db25 commit 6d33820
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 6d33820

Please sign in to comment.