Add binaries to binary branch instead of master (#441)
This commit is contained in:
33
.github/workflows/beta.yml
vendored
33
.github/workflows/beta.yml
vendored
@@ -49,6 +49,7 @@ jobs:
|
||||
Version: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
|
||||
run: |
|
||||
sed -i "s/unknownbuildnr/$Version/g" src/Config.h
|
||||
python3 resources/config_version.py beta
|
||||
- name: Build ${{ matrix.build }} PlatformIO Project ${{ matrix.board }}
|
||||
run: |
|
||||
if [ "$BUILD" = "debug" ]; then
|
||||
@@ -97,7 +98,21 @@ jobs:
|
||||
- name: Git Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
ref: binary
|
||||
- name: Git Checkout master
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: master
|
||||
path: master
|
||||
sparse-checkout: |
|
||||
resources/ota_manifest.py
|
||||
src/Config.h
|
||||
- name: Git Commands
|
||||
run: |
|
||||
git checkout --orphan newBinary
|
||||
git branch -D binary
|
||||
git branch -M binary
|
||||
git rm --cached --ignore-unmatch -r *
|
||||
- name: Download release assets
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
@@ -108,17 +123,23 @@ jobs:
|
||||
Version: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
|
||||
run: |
|
||||
mkdir -p ota/beta/
|
||||
mkdir -p resources/
|
||||
mkdir -p src/
|
||||
cp -vf release/*/nuki_hub_*.bin ota/beta/
|
||||
rm -rf release
|
||||
cp -vf master/resources/ota_manifest.py resources/ota_manifest.py
|
||||
cp -vf master/src/Config.h src/Config.h
|
||||
python3 resources/ota_manifest.py beta $Version
|
||||
- name: Commit binaries to master
|
||||
find * -not -path "ota*" -not -path "webflash*" -delete
|
||||
rm -rf .github .gitignore .gitmodules
|
||||
- name: Commit binaries to binary
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: "Update beta binaries"
|
||||
file_pattern: 'ota/beta/*.bin ota/manifest.json'
|
||||
branch: master
|
||||
commit_message: "Update binaries"
|
||||
file_pattern: 'ota/* ota/master/* ota/beta/* webflash/*'
|
||||
branch: binary
|
||||
skip_dirty_check: true
|
||||
skip_fetch: true
|
||||
skip_checkout: true
|
||||
disable_globbing: true
|
||||
add_options: '-f'
|
||||
push_options: '-f'
|
||||
|
||||
39
.github/workflows/nightly.yml
vendored
39
.github/workflows/nightly.yml
vendored
@@ -19,12 +19,11 @@ jobs:
|
||||
submodules: recursive
|
||||
- name: Get new commits
|
||||
run: echo "NEW_COMMIT_COUNT=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_ENV
|
||||
- name: Check if commits larger than 1
|
||||
if: ${{ env.NEW_COMMIT_COUNT < 2 }}
|
||||
- name: Check if commits larger than 0
|
||||
if: ${{ env.NEW_COMMIT_COUNT < 1 }}
|
||||
run: exit 1
|
||||
build:
|
||||
name: Build ${{ matrix.board }} (${{ matrix.build }})
|
||||
if: github.repository == 'technyon/nuki_hub'
|
||||
needs: check-commits
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
@@ -67,6 +66,7 @@ jobs:
|
||||
Version: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
|
||||
run: |
|
||||
sed -i "s/unknownbuildnr/$Version/g" src/Config.h
|
||||
python3 resources/config_version.py master
|
||||
- name: Build ${{ matrix.build }} PlatformIO Project ${{ matrix.board }}
|
||||
run: |
|
||||
if [ "$BUILD" = "debug" ]; then
|
||||
@@ -109,14 +109,27 @@ jobs:
|
||||
path: ${{ matrix.build }}/${{ env.VARIANT }}
|
||||
ota-nightly:
|
||||
name: Create nightly from latest master
|
||||
if: github.repository == 'technyon/nuki_hub'
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Git Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
ref: binary
|
||||
- name: Git Checkout master
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: master
|
||||
path: master
|
||||
sparse-checkout: |
|
||||
resources/ota_manifest.py
|
||||
src/Config.h
|
||||
- name: Git Commands
|
||||
run: |
|
||||
git checkout --orphan newBinary
|
||||
git branch -D binary
|
||||
git branch -M binary
|
||||
git rm --cached --ignore-unmatch -r *
|
||||
- name: Download release assets
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
@@ -127,17 +140,23 @@ jobs:
|
||||
Version: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
|
||||
run: |
|
||||
mkdir -p ota/master/
|
||||
mkdir -p resources/
|
||||
mkdir -p src/
|
||||
cp -vf release/*/nuki_hub_*.bin ota/master/
|
||||
rm -rf release
|
||||
cp -vf master/resources/ota_manifest.py resources/ota_manifest.py
|
||||
cp -vf master/src/Config.h src/Config.h
|
||||
python3 resources/ota_manifest.py master $Version
|
||||
- name: Commit binaries to master
|
||||
find * -not -path "ota*" -not -path "webflash*" -delete
|
||||
rm -rf .github .gitignore .gitmodules
|
||||
- name: Commit binaries to binary
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: "Update master binaries"
|
||||
file_pattern: 'ota/master/*.bin ota/manifest.json'
|
||||
branch: master
|
||||
commit_message: "Update binaries"
|
||||
file_pattern: 'ota/* ota/master/* ota/beta/* webflash/*'
|
||||
branch: binary
|
||||
skip_dirty_check: true
|
||||
skip_fetch: true
|
||||
skip_checkout: true
|
||||
disable_globbing: true
|
||||
add_options: '-f'
|
||||
push_options: '-f'
|
||||
|
||||
39
.github/workflows/release.yml
vendored
39
.github/workflows/release.yml
vendored
@@ -97,10 +97,24 @@ jobs:
|
||||
- name: Git Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
ref: binary
|
||||
- name: Git Checkout master
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: master
|
||||
path: master
|
||||
sparse-checkout: |
|
||||
resources/ota_manifest.py
|
||||
src/Config.h
|
||||
- name: Git Commands
|
||||
run: |
|
||||
git checkout --orphan newBinary
|
||||
git branch -D binary
|
||||
git branch -M binary
|
||||
git rm --cached --ignore-unmatch -r *
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: echo "VERSION=$(cat src/Config.h | grep -oP '(?<=#define NUKI_HUB_VERSION \")(.*)(?=\")')" >> $GITHUB_OUTPUT
|
||||
run: echo "VERSION=$(cat master/src/Config.h | grep -oP '(?<=#define NUKI_HUB_VERSION \")(.*)(?=\")')" >> $GITHUB_OUTPUT
|
||||
- name: Download release assets
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
@@ -167,22 +181,27 @@ jobs:
|
||||
env:
|
||||
Version: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
|
||||
run: |
|
||||
mkdir -p ota/
|
||||
mkdir -p resources/
|
||||
mkdir -p src/
|
||||
cp -vf release/*/nuki_hub_*.bin ota/
|
||||
cp -vf release/*/webflash_nuki_hub_*.bin webflash/
|
||||
rm -rf release
|
||||
rm -rf debug
|
||||
rm -rf NukiHub-*.zip
|
||||
git rm -r --cached ota/beta/*.bin
|
||||
cp -vf master/resources/ota_manifest.py resources/ota_manifest.py
|
||||
cp -vf master/src/Config.h src/Config.h
|
||||
python3 resources/ota_manifest.py release $Version
|
||||
python3 resources/ota_manifest.py beta none
|
||||
- name: Commit binaries to master
|
||||
find * -not -path "ota*" -not -path "webflash*" -delete
|
||||
rm -rf ota/beta/*.bin
|
||||
rm -rf .github .gitignore .gitmodules
|
||||
- name: Commit binaries to binary
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: "Update binaries for version ${{ steps.get_version.outputs.VERSION }}"
|
||||
file_pattern: 'ota/*.bin ota/manifest.json ota/beta/*.bin webflash/*.bin'
|
||||
branch: master
|
||||
commit_message: "Update binaries"
|
||||
file_pattern: 'ota/* ota/master/* webflash/*'
|
||||
branch: binary
|
||||
skip_dirty_check: true
|
||||
skip_fetch: true
|
||||
skip_checkout: true
|
||||
disable_globbing: true
|
||||
add_options: '-f'
|
||||
push_options: '-f'
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
type="module"
|
||||
src="https://unpkg.com/esp-web-tools@8.0.1/dist/web/install-button.js?module">
|
||||
</script>
|
||||
<esp-web-install-button id="installButton" manifest="webflash/manifest.json"></esp-web-install-button>
|
||||
<esp-web-install-button id="installButton" manifest="https://raw.githubusercontent.com/technyon/nuki_hub/binary/webflash/manifest.json"></esp-web-install-button>
|
||||
<br><br><br><br>
|
||||
Note: If flashing doesn't work, press and hold the "BOOT" switch, then click "Install".
|
||||
</div>
|
||||
|
||||
12
pio_package_pre.py
Normal file
12
pio_package_pre.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import re, shutil, os
|
||||
from datetime import datetime, timezone
|
||||
|
||||
regex = r"\#define NUKI_HUB_DATE \"(.*)\""
|
||||
content_new = ""
|
||||
|
||||
with open ('src/Config.h', 'r' ) as readfile:
|
||||
file_content = readfile.read()
|
||||
content_new = re.sub(regex, "#define NUKI_HUB_DATE \"" + datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S") + "\"", file_content, flags = re.M)
|
||||
|
||||
with open('src/Config.h', 'w') as writefile:
|
||||
writefile.write(content_new)
|
||||
@@ -59,7 +59,9 @@ monitor_filters =
|
||||
|
||||
[env:esp32dev]
|
||||
board = esp32dev
|
||||
extra_scripts = post:pio_package.py
|
||||
extra_scripts =
|
||||
pre:pio_package_pre.py
|
||||
post:pio_package.py
|
||||
build_flags =
|
||||
${env.build_flags}
|
||||
-DBLESCANNER_USE_LATEST_NIMBLE
|
||||
@@ -87,7 +89,9 @@ board = esp32-c6-devkitm-1
|
||||
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32-2023.10.03.zip
|
||||
framework = arduino
|
||||
board = esp32-solo1
|
||||
extra_scripts = post:pio_package.py
|
||||
extra_scripts =
|
||||
pre:pio_package_pre.py
|
||||
post:pio_package.py
|
||||
build_flags =
|
||||
${env.build_flags}
|
||||
-DFRAMEWORK_ARDUINO_SOLO1
|
||||
|
||||
40
resources/config_version.py
Normal file
40
resources/config_version.py
Normal file
@@ -0,0 +1,40 @@
|
||||
import re, json, argparse
|
||||
from urllib.request import urlopen
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
parser.add_argument('ota_type', type=str)
|
||||
args = parser.parse_args()
|
||||
|
||||
regex = r"\#define NUKI_HUB_VERSION \"(.*)\""
|
||||
version = "unknown"
|
||||
|
||||
with open('src/Config.h', 'r') as file:
|
||||
file_content = file.read()
|
||||
matches = re.finditer(regex, file_content, re.MULTILINE)
|
||||
|
||||
for matchNum, match in enumerate(matches, start=1):
|
||||
for groupNum in range(0, len(match.groups())):
|
||||
groupNum = groupNum + 1
|
||||
version = match.group(groupNum)
|
||||
|
||||
data = ""
|
||||
number = 1
|
||||
|
||||
response = urlopen("https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/manifest.json")
|
||||
data = json.loads(response.read().decode("utf-8"))
|
||||
if ("number" not in data[args.ota_type]):
|
||||
number = 1
|
||||
elif (data[args.ota_type]['version'] == version):
|
||||
number = data[args.ota_type]['number'] + 1
|
||||
else:
|
||||
number = 1
|
||||
|
||||
content_new = ""
|
||||
|
||||
with open ('src/Config.h', 'r' ) as readfile:
|
||||
file_content = readfile.read()
|
||||
content_new = re.sub(regex, "#define NUKI_HUB_VERSION \"" + str(version) + "-" + args.ota_type + str(number) + "\"", file_content, flags = re.M)
|
||||
|
||||
with open('src/Config.h', 'w') as writefile:
|
||||
writefile.write(content_new)
|
||||
@@ -25,7 +25,15 @@ with open('ota/manifest.json', 'r+') as json_file:
|
||||
data[args.ota_type]['time'] = "0000-00-00 00:00:00"
|
||||
data[args.ota_type]['version'] = "No beta available"
|
||||
data[args.ota_type]['build'] = ""
|
||||
del(data[args.ota_type]['number'])
|
||||
else:
|
||||
if ("number" not in data[args.ota_type]):
|
||||
data[args.ota_type]['number'] = 1
|
||||
elif (data[args.ota_type]['version'] == version):
|
||||
data[args.ota_type]['number'] = data[args.ota_type]['number'] + 1
|
||||
else:
|
||||
data[args.ota_type]['number'] = 1
|
||||
|
||||
data[args.ota_type]['time'] = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S")
|
||||
data[args.ota_type]['version'] = version
|
||||
data[args.ota_type]['build'] = args.build
|
||||
|
||||
63
src/Config.h
63
src/Config.h
@@ -4,47 +4,48 @@
|
||||
|
||||
#define NUKI_HUB_VERSION "9.00"
|
||||
#define NUKI_HUB_BUILD "unknownbuildnr"
|
||||
#define NUKI_HUB_DATE "unknownbuilddate"
|
||||
|
||||
#define GITHUB_LATEST_RELEASE_URL (char*)"https://github.com/technyon/nuki_hub/releases/latest"
|
||||
#define GITHUB_LATEST_RELEASE_API_URL (char*)"https://api.github.com/repos/technyon/nuki_hub/releases/latest"
|
||||
#define GITHUB_OTA_MANIFEST_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/manifest.json"
|
||||
#define GITHUB_OTA_MANIFEST_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/manifest.json"
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||
#define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/nuki_hub_esp32c3.bin"
|
||||
#define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/nuki_hub_updater_esp32c3.bin"
|
||||
#define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/beta/nuki_hub_esp32c3.bin"
|
||||
#define GITHUB_BETA_UPDATER_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/beta/nuki_hub_updater_esp32c3.bin"
|
||||
#define GITHUB_MASTER_RELEASE_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/master/nuki_hub_esp32c3.bin"
|
||||
#define GITHUB_MASTER_UPDATER_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/master/nuki_hub_updater_esp32c3.bin"
|
||||
#define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32c3.bin"
|
||||
#define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32c3.bin"
|
||||
#define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_esp32c3.bin"
|
||||
#define GITHUB_BETA_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_updater_esp32c3.bin"
|
||||
#define GITHUB_MASTER_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_esp32c3.bin"
|
||||
#define GITHUB_MASTER_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_updater_esp32c3.bin"
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||
#define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/nuki_hub_esp32s3.bin"
|
||||
#define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/nuki_hub_updater_esp32s3.bin"
|
||||
#define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/beta/nuki_hub_esp32s3.bin"
|
||||
#define GITHUB_BETA_UPDATER_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/beta/nuki_hub_updater_esp32s3.bin"
|
||||
#define GITHUB_MASTER_RELEASE_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/master/nuki_hub_esp32s3.bin"
|
||||
#define GITHUB_MASTER_UPDATER_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/master/nuki_hub_updater_esp32s3.bin"
|
||||
#define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32s3.bin"
|
||||
#define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32s3.bin"
|
||||
#define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_esp32s3.bin"
|
||||
#define GITHUB_BETA_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_updater_esp32s3.bin"
|
||||
#define GITHUB_MASTER_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_esp32s3.bin"
|
||||
#define GITHUB_MASTER_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_updater_esp32s3.bin"
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32C6)
|
||||
#define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/nuki_hub_esp32c6.bin"
|
||||
#define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/nuki_hub_updater_esp32c6.bin"
|
||||
#define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/beta/nuki_hub_esp32c6.bin"
|
||||
#define GITHUB_BETA_UPDATER_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/beta/nuki_hub_updater_esp32c6.bin"
|
||||
#define GITHUB_MASTER_RELEASE_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/master/nuki_hub_esp32c6.bin"
|
||||
#define GITHUB_MASTER_UPDATER_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/master/nuki_hub_updater_esp32c6.bin"
|
||||
#define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32c6.bin"
|
||||
#define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32c6.bin"
|
||||
#define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_esp32c6.bin"
|
||||
#define GITHUB_BETA_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_updater_esp32c6.bin"
|
||||
#define GITHUB_MASTER_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_esp32c6.bin"
|
||||
#define GITHUB_MASTER_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_updater_esp32c6.bin"
|
||||
#else
|
||||
#if defined(FRAMEWORK_ARDUINO_SOLO1)
|
||||
#define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/nuki_hub_esp32solo1.bin"
|
||||
#define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/nuki_hub_updater_esp32solo1.bin"
|
||||
#define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/beta/nuki_hub_esp32solo1.bin"
|
||||
#define GITHUB_BETA_UPDATER_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/beta/nuki_hub_updater_esp32solo1.bin"
|
||||
#define GITHUB_MASTER_RELEASE_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/master/nuki_hub_esp32solo1.bin"
|
||||
#define GITHUB_MASTER_UPDATER_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/master/nuki_hub_updater_esp32solo1.bin"
|
||||
#define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32solo1.bin"
|
||||
#define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32solo1.bin"
|
||||
#define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_esp32solo1.bin"
|
||||
#define GITHUB_BETA_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_updater_esp32solo1.bin"
|
||||
#define GITHUB_MASTER_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_esp32solo1.bin"
|
||||
#define GITHUB_MASTER_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_updater_esp32solo1.bin"
|
||||
#else
|
||||
#define GITHUB_LATEST_RELEASE_BINARY_URL "https://github.com/technyon/nuki_hub/raw/master/ota/nuki_hub_esp32.bin"
|
||||
#define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/nuki_hub_updater_esp32.bin"
|
||||
#define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/beta/nuki_hub_esp32.bin"
|
||||
#define GITHUB_BETA_UPDATER_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/beta/nuki_hub_updater_esp32.bin"
|
||||
#define GITHUB_MASTER_RELEASE_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/master/nuki_hub_esp32.bin"
|
||||
#define GITHUB_MASTER_UPDATER_BINARY_URL (char*)"https://github.com/technyon/nuki_hub/raw/master/ota/master/nuki_hub_updater_esp32.bin"
|
||||
#define GITHUB_LATEST_RELEASE_BINARY_URL "https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32.bin"
|
||||
#define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32.bin"
|
||||
#define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_esp32.bin"
|
||||
#define GITHUB_BETA_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_updater_esp32.bin"
|
||||
#define GITHUB_MASTER_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_esp32.bin"
|
||||
#define GITHUB_MASTER_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_updater_esp32.bin"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -426,7 +426,9 @@ void WebCfgServer::buildOtaHtml(String &response, bool errored)
|
||||
response.concat(NUKI_HUB_VERSION);
|
||||
response.concat(" (");
|
||||
response.concat(NUKI_HUB_BUILD);
|
||||
response.concat(")<br>");
|
||||
response.concat("), ");
|
||||
response.concat(NUKI_HUB_DATE);
|
||||
response.concat("<br>");
|
||||
|
||||
#ifndef NUKI_HUB_UPDATER
|
||||
HTTPClient https;
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
import shutil
|
||||
import re, shutil, os
|
||||
from datetime import datetime, timezone
|
||||
|
||||
regex = r"\#define NUKI_HUB_DATE \"(.*)\""
|
||||
content_new = ""
|
||||
|
||||
with open ('../src/Config.h', 'r' ) as readfile:
|
||||
file_content = readfile.read()
|
||||
content_new = re.sub(regex, "#define NUKI_HUB_DATE \"" + datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S") + "\"", file_content, flags = re.M)
|
||||
|
||||
with open('../src/Config.h', 'w') as writefile:
|
||||
writefile.write(content_new)
|
||||
|
||||
shutil.copy("../src/main.cpp", "src/main.cpp")
|
||||
@@ -1,5 +1,5 @@
|
||||
import shutil
|
||||
import os
|
||||
import re, shutil, os
|
||||
from datetime import datetime, timezone
|
||||
|
||||
if not os.path.exists('src/networkDevices/'):
|
||||
os.mkdir('src/networkDevices')
|
||||
@@ -30,3 +30,13 @@ shutil.copy("../src/networkDevices/IPConfiguration.cpp", "src/networkDevices/IPC
|
||||
shutil.copy("../src/networkDevices/NetworkDevice.cpp", "src/networkDevices/NetworkDevice.cpp")
|
||||
shutil.copy("../src/networkDevices/W5500Device.cpp", "src/networkDevices/W5500Device.cpp")
|
||||
shutil.copy("../src/networkDevices/WifiDevice.cpp", "src/networkDevices/WifiDevice.cpp")
|
||||
|
||||
regex = r"\#define NUKI_HUB_DATE \"(.*)\""
|
||||
content_new = ""
|
||||
|
||||
with open ('src/Config.h', 'r' ) as readfile:
|
||||
file_content = readfile.read()
|
||||
content_new = re.sub(regex, "#define NUKI_HUB_DATE \"" + datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S") + "\"", file_content, flags = re.M)
|
||||
|
||||
with open('src/Config.h', 'w') as writefile:
|
||||
writefile.write(content_new)
|
||||
Reference in New Issue
Block a user