diff --git a/.github/workflows/Tasmota_build_development.yml b/.github/workflows/Tasmota_build_development.yml index 73523b124..dc3b1fe44 100644 --- a/.github/workflows/Tasmota_build_development.yml +++ b/.github/workflows/Tasmota_build_development.yml @@ -8,27 +8,8 @@ on: - '.github/**' # Ignore changes towards the .github directory jobs: - tasmota_pull: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Use latest Tasmota development - run: | - git config --local user.name "Platformio BUILD" - git config user.email github-actions@github.com - git switch -c work - git remote add -f Tasmota "https://github.com/arendst/Tasmota.git" --track development - git merge Tasmota/development --allow-unrelated-histories - - name: Push Tasmota # Push updates of latest Tasmota development to repo - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: 'development' - tasmota: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -48,7 +29,6 @@ jobs: tasmota-minimal: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -68,7 +48,6 @@ jobs: tasmota-lite: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -88,7 +67,6 @@ jobs: tasmota-knx: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -108,7 +86,6 @@ jobs: tasmota-sensors: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -128,7 +105,6 @@ jobs: tasmota-display: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -148,7 +124,6 @@ jobs: tasmota-ir: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -168,7 +143,6 @@ jobs: tasmota-zbbridge: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -188,7 +162,6 @@ jobs: tasmota-zigbee: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -208,7 +181,6 @@ jobs: tasmota-AF: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -228,7 +200,6 @@ jobs: tasmota-BG: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -248,7 +219,6 @@ jobs: tasmota-BR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -268,7 +238,6 @@ jobs: tasmota-CN: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -288,7 +257,6 @@ jobs: tasmota-CZ: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -308,7 +276,6 @@ jobs: tasmota-DE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -328,7 +295,6 @@ jobs: tasmota-ES: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -348,7 +314,6 @@ jobs: tasmota-FR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -368,7 +333,6 @@ jobs: tasmota-FY: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -388,7 +352,6 @@ jobs: tasmota-GR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -408,7 +371,6 @@ jobs: tasmota-HE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -428,7 +390,6 @@ jobs: tasmota-HU: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -448,7 +409,6 @@ jobs: tasmota-IT: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -468,7 +428,6 @@ jobs: tasmota-KO: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -488,7 +447,6 @@ jobs: tasmota-NL: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -508,7 +466,6 @@ jobs: tasmota-PL: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -528,7 +485,6 @@ jobs: tasmota-PT: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -548,7 +504,6 @@ jobs: tasmota-RO: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -568,7 +523,6 @@ jobs: tasmota-RU: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -588,7 +542,6 @@ jobs: tasmota-SE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -608,7 +561,6 @@ jobs: tasmota-SK: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -628,7 +580,6 @@ jobs: tasmota-TR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -648,7 +599,6 @@ jobs: tasmota-TW: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -668,7 +618,6 @@ jobs: tasmota-UK: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -688,7 +637,6 @@ jobs: tasmota-VN: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -708,7 +656,6 @@ jobs: tasmota32: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -728,7 +675,6 @@ jobs: tasmota32solo1: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -748,7 +694,6 @@ jobs: tasmota32-webcam: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -768,7 +713,6 @@ jobs: tasmota32-odroidgo: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -788,7 +732,6 @@ jobs: tasmota32-core2: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -808,7 +751,6 @@ jobs: tasmota32-bluetooth: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -828,7 +770,6 @@ jobs: tasmota32-display: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -848,7 +789,6 @@ jobs: tasmota32-lvgl: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -868,7 +808,6 @@ jobs: tasmota32-ir: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -888,7 +827,6 @@ jobs: tasmota32-AF: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -908,7 +846,6 @@ jobs: tasmota32-BG: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -928,7 +865,6 @@ jobs: tasmota32-BR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -948,7 +884,6 @@ jobs: tasmota32-CN: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -968,7 +903,6 @@ jobs: tasmota32-CZ: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -988,7 +922,6 @@ jobs: tasmota32-DE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1008,7 +941,6 @@ jobs: tasmota32-ES: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1028,7 +960,6 @@ jobs: tasmota32-FR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1048,7 +979,6 @@ jobs: tasmota32-FY: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1068,7 +998,6 @@ jobs: tasmota32-GR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1088,7 +1017,6 @@ jobs: tasmota32-HE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1108,7 +1036,6 @@ jobs: tasmota32-HU: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1128,7 +1055,6 @@ jobs: tasmota32-IT: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1148,7 +1074,6 @@ jobs: tasmota32-KO: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1168,7 +1093,6 @@ jobs: tasmota32-NL: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1188,7 +1112,6 @@ jobs: tasmota32-PL: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1208,7 +1131,6 @@ jobs: tasmota32-PT: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1228,7 +1150,6 @@ jobs: tasmota32-RO: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1248,7 +1169,6 @@ jobs: tasmota32-RU: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1268,7 +1188,6 @@ jobs: tasmota32-SE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1288,7 +1207,6 @@ jobs: tasmota32-SK: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1308,7 +1226,6 @@ jobs: tasmota32-TR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1328,7 +1245,6 @@ jobs: tasmota32-TW: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1348,7 +1264,6 @@ jobs: tasmota32-UK: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1368,7 +1283,6 @@ jobs: tasmota32-VN: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: diff --git a/.github/workflows/Tasmota_build_master.yml b/.github/workflows/Tasmota_build_master.yml index 9153051dc..5bc79c06d 100644 --- a/.github/workflows/Tasmota_build_master.yml +++ b/.github/workflows/Tasmota_build_master.yml @@ -7,27 +7,8 @@ on: - '.github/**' # Ignore changes towards the .github directory jobs: - tasmota_pull: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Use Tasmota master - run: | - git config --local user.name "Platformio BUILD" - git config user.email github-actions@github.com - git switch -c work - git remote add -f Tasmota "https://github.com/arendst/Tasmota.git" --track master - git merge Tasmota/master --allow-unrelated-histories - - name: Push Tasmota # Push updates of latest Tasmota master to repo - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: 'master' - tasmota: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -47,7 +28,6 @@ jobs: tasmota-minimal: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -67,7 +47,6 @@ jobs: tasmota-lite: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -87,7 +66,6 @@ jobs: tasmota-knx: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -107,7 +85,6 @@ jobs: tasmota-sensors: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -127,7 +104,6 @@ jobs: tasmota-display: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -147,7 +123,6 @@ jobs: tasmota-ir: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -167,7 +142,6 @@ jobs: tasmota-zbbridge: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -187,7 +161,6 @@ jobs: tasmota-zigbee: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -207,7 +180,6 @@ jobs: tasmota-AF: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -227,7 +199,6 @@ jobs: tasmota-BG: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -247,7 +218,6 @@ jobs: tasmota-BR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -267,7 +237,6 @@ jobs: tasmota-CN: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -287,7 +256,6 @@ jobs: tasmota-CZ: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -307,7 +275,6 @@ jobs: tasmota-DE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -327,7 +294,6 @@ jobs: tasmota-ES: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -347,7 +313,6 @@ jobs: tasmota-FR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -367,7 +332,6 @@ jobs: tasmota-FY: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -387,7 +351,6 @@ jobs: tasmota-GR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -407,7 +370,6 @@ jobs: tasmota-HE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -427,7 +389,6 @@ jobs: tasmota-HU: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -447,7 +408,6 @@ jobs: tasmota-IT: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -467,7 +427,6 @@ jobs: tasmota-KO: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -487,7 +446,6 @@ jobs: tasmota-NL: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -507,7 +465,6 @@ jobs: tasmota-PL: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -527,7 +484,6 @@ jobs: tasmota-PT: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -547,7 +503,6 @@ jobs: tasmota-RO: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -567,7 +522,6 @@ jobs: tasmota-RU: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -587,7 +541,6 @@ jobs: tasmota-SE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -607,7 +560,6 @@ jobs: tasmota-SK: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -627,7 +579,6 @@ jobs: tasmota-TR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -647,7 +598,6 @@ jobs: tasmota-TW: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -667,7 +617,6 @@ jobs: tasmota-UK: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -687,7 +636,6 @@ jobs: tasmota-VN: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -707,7 +655,6 @@ jobs: tasmota32: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -727,7 +674,6 @@ jobs: tasmota32solo1: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -747,7 +693,6 @@ jobs: tasmota32-webcam: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -767,7 +712,6 @@ jobs: tasmota32-odroidgo: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -787,7 +731,6 @@ jobs: tasmota32-core2: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -807,7 +750,6 @@ jobs: tasmota32-bluetooth: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -827,7 +769,6 @@ jobs: tasmota32-display: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -847,7 +788,6 @@ jobs: tasmota32-lvgl: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -867,7 +807,6 @@ jobs: tasmota32-ir: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -887,7 +826,6 @@ jobs: tasmota32-AF: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -907,7 +845,6 @@ jobs: tasmota32-BG: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -927,7 +864,6 @@ jobs: tasmota32-BR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -947,7 +883,6 @@ jobs: tasmota32-CN: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -967,7 +902,6 @@ jobs: tasmota32-CZ: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -987,7 +921,6 @@ jobs: tasmota32-DE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1007,7 +940,6 @@ jobs: tasmota32-ES: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1027,7 +959,6 @@ jobs: tasmota32-FR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1047,7 +978,6 @@ jobs: tasmota32-FY: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1067,7 +997,6 @@ jobs: tasmota32-GR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1087,7 +1016,6 @@ jobs: tasmota32-HE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1107,7 +1035,6 @@ jobs: tasmota32-HU: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1127,7 +1054,6 @@ jobs: tasmota32-IT: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1147,7 +1073,6 @@ jobs: tasmota32-KO: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1167,7 +1092,6 @@ jobs: tasmota32-NL: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1187,7 +1111,6 @@ jobs: tasmota32-PL: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1207,7 +1130,6 @@ jobs: tasmota32-PT: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1227,7 +1149,6 @@ jobs: tasmota32-RO: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1247,7 +1168,6 @@ jobs: tasmota32-RU: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1267,7 +1187,6 @@ jobs: tasmota32-SE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1287,7 +1206,6 @@ jobs: tasmota32-SK: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1307,7 +1225,6 @@ jobs: tasmota32-TR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1327,7 +1244,6 @@ jobs: tasmota32-TW: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1347,7 +1263,6 @@ jobs: tasmota32-UK: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: @@ -1367,7 +1282,6 @@ jobs: tasmota32-VN: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 8426f33ac..89c3afe39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,9 +13,10 @@ All notable changes to this project will be documented in this file. - Make Sonoff L1 MusicSync persistent (#12008) - Relax NTP poll if no ntpserver can be resolved by DNS - Move firmware binaries to https://github.com/arendst/Tasmota-firmware/tree/main/release-firmware -- Prometheus: All metrics are prefixed with ``tasmota_``; memory metrics have - been cleaned up to work consistently between ESP8266 and ESP32; the device - name is reported as an info metric +- Prometheus: All metrics are prefixed with ``tasmota_`` + memory metrics have been cleaned up to work consistently between ESP8266 and ESP32 + the device name is reported as an info metric +- Default disable CORS for enhanced security and provide user compile option ``#define USE_CORS`` (#12827) ### Fixed - Neopool communication error (#12813) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index c9868e41d..5ad7a6e5b 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -137,6 +137,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo - Allow buttons to work in AP normal mode [#12518](https://github.com/arendst/Tasmota/issues/12518) - Enable Ping and rule features for any device compiled with more than 1M flash size [#12539](https://github.com/arendst/Tasmota/issues/12539) - Replace spaces by hyphens in final hostname [#12710](https://github.com/arendst/Tasmota/issues/12710) +- Default disable CORS for enhanced security and provide user compile option ``#define USE_CORS`` [#12827](https://github.com/arendst/Tasmota/issues/12827) ### Fixed - ESP32 core v2.0.0 setting hostname diff --git a/pio-tools/gzip-firmware.py b/pio-tools/gzip-firmware.py index e99973af4..fac23cf2d 100644 --- a/pio-tools/gzip-firmware.py +++ b/pio-tools/gzip-firmware.py @@ -14,18 +14,20 @@ def map_gzip(source, target, env): # create string with location and file names based on variant bin_file = "{}map{}{}.map".format(OUTPUT_DIR, os.path.sep, variant) - gzip_file = "{}map{}{}.map.gz".format(OUTPUT_DIR, os.path.sep, variant) - # check if new target map files exist and remove if necessary - if os.path.isfile(gzip_file): os.remove(gzip_file) + if os.path.isfile(bin_file): + gzip_file = "{}map{}{}.map.gz".format(OUTPUT_DIR, os.path.sep, variant) - # write gzip map file - with open(bin_file,"rb") as fp: - with gzip.open(gzip_file, "wb", compresslevel = 9) as f: - shutil.copyfileobj(fp, f) + # check if new target map files exist and remove if necessary + if os.path.isfile(gzip_file): os.remove(gzip_file) - # remove map file - if os.path.isfile(bin_file): os.remove(bin_file) + # write gzip map file + with open(bin_file,"rb") as fp: + with gzip.open(gzip_file, "wb", compresslevel = 9) as f: + shutil.copyfileobj(fp, f) + + # remove map file + if os.path.isfile(bin_file): os.remove(bin_file) env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [map_gzip])