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 b3c4668
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: npm install && npm run dist
- name: Get supported target version artifacts
run: |
mkdir -p dist
cd dist
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/" ../../src/js/index.js
- name: Build
run: npm install && npm run dist
- 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 b3c4668

Please sign in to comment.