Save old version for OTA and Webflash
This commit is contained in:
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
@@ -154,6 +154,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p ota/beta/
|
mkdir -p ota/beta/
|
||||||
mkdir -p ota/master/
|
mkdir -p ota/master/
|
||||||
|
mkdir -p ota/old/
|
||||||
mkdir -p resources/
|
mkdir -p resources/
|
||||||
mkdir -p src/
|
mkdir -p src/
|
||||||
cp -vf release/*/nuki_hub_*.bin ota/
|
cp -vf release/*/nuki_hub_*.bin ota/
|
||||||
@@ -168,11 +169,13 @@ jobs:
|
|||||||
rm -rf .github .gitignore .gitmodules
|
rm -rf .github .gitignore .gitmodules
|
||||||
touch ota/beta/empty
|
touch ota/beta/empty
|
||||||
touch ota/master/empty
|
touch ota/master/empty
|
||||||
|
echo release/*/nuki_hub_*.bin | tr ' ' '\n' | xargs -n1 -I{} bash -c 'cp {} ota/old/$VERSION.$(basename "{}")'
|
||||||
|
python3 resources/old_manifest.py $Version
|
||||||
- name: Commit binaries to binary
|
- name: Commit binaries to binary
|
||||||
uses: stefanzweifel/git-auto-commit-action@v5
|
uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
commit_message: "Update binaries"
|
commit_message: "Update binaries"
|
||||||
file_pattern: 'ota/* ota/master/* ota/beta/*'
|
file_pattern: 'ota/* ota/master/* ota/beta/* ota/old/*'
|
||||||
branch: binary
|
branch: binary
|
||||||
skip_dirty_check: true
|
skip_dirty_check: true
|
||||||
skip_fetch: true
|
skip_fetch: true
|
||||||
|
|||||||
20
resources/old_manifest.py
Normal file
20
resources/old_manifest.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import re, json, argparse
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
|
||||||
|
parser.add_argument('version', type=str)
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
with open('ota/old/manifest.json', 'r+') as json_file:
|
||||||
|
data = json.load(json_file)
|
||||||
|
data[str(int((float(args.version)*100)+0.1))] = args.version
|
||||||
|
data2 = sorted(data.items(), reverse=True)
|
||||||
|
sorted_dict = {}
|
||||||
|
k = 6
|
||||||
|
for key, value in data2:
|
||||||
|
if k > 0:
|
||||||
|
sorted_dict[key] = value
|
||||||
|
k = k - 1
|
||||||
|
json_file.seek(0)
|
||||||
|
json.dump(sorted_dict, json_file, indent=4)
|
||||||
|
json_file.truncate()
|
||||||
Reference in New Issue
Block a user