diff --git a/.github/workflows/gen-configs.yaml b/.github/workflows/gen-configs.yaml index 42c6b6ca92..8d4bd5ff41 100644 --- a/.github/workflows/gen-configs.yaml +++ b/.github/workflows/gen-configs.yaml @@ -14,10 +14,17 @@ jobs: with: fetch-depth: 0 + - name: Install Tools + run: sudo apt-get install ncftp + - name: Generate Configs working-directory: ./firmware/ run: sh gen_config.sh + - name: Upload .ini files + working-directory: ./firmware/tunerstudio + run: ./upload.sh ${{ secrets.RUSEFI_ONLINE_FTP_USER }} ${{ secrets.RUSEFI_ONLINE_FTP_PASS }} ${{ secrets.RUSEFI_FTP_SERVER }} + - name: Generate Live Documentation working-directory: ./firmware/ run: sh gen_live_documentation.sh diff --git a/firmware/tunerstudio/upload.sh b/firmware/tunerstudio/upload.sh new file mode 100644 index 0000000000..598d61faa0 --- /dev/null +++ b/firmware/tunerstudio/upload.sh @@ -0,0 +1,25 @@ +#!/bin/bash + + +if [ ! "$1" ] || [ ! "$2" ] || [ ! "$3" ]; then + echo "No Secrets" + exit 0 +fi + +echo -e "\nUploading .ini files" + +for f in *.ini; do if [[ -f "$f" ]]; then + echo "Processing file $f:" + sig=$(grep "^ *signature *=" $f | cut -f2 -d "=") + if [ ! -z "$sig" -a "$sig" != " " ]; then + echo "* found signature: $sig" + if [[ "$sig" =~ rusEFI.*([0-9]{4}[^\"]+) ]]; then + sig=${BASH_REMATCH[1]} + sig="${sig//\./\/}.ini" + path="/rusefi/$sig" + echo "* found path: $path" + ncftpput -m -R -v -u "$1" -p "$2" "$3" autoupdate $path + echo "* upload done!" + fi + fi +fi; done