feat: testing createzip script

This commit is contained in:
ZanzyTHEbar 2023-01-31 14:49:54 +00:00
parent af89d4d380
commit 3094c29d1f
2 changed files with 10 additions and 9 deletions

View File

@ -50,10 +50,6 @@ jobs:
run: |
sed -i '/\[env\]/p; s/\[env\]/upload_protocol = custom/' platformio.ini
# sed -i '/\[env\]/p; s/\[env\]/upload_command = \$PYTHONEXE .\/tools\/createzip.py \$FLASH_EXTRA_IMAGES \$ESP32_APP_OFFSET \$SOURCE/' platformio.ini
- name: Archive Firmware name File
# create an environment variable with the name of the firmware file by catting the firmware_name.txt file
run: |
echo "FIRMWARE_NAME=$(cat ./ESP/tools/firmware_name.txt)" >> $GITHUB_ENV
- name: Build OpenIris Firmware
working-directory: ./ESP
run: |
@ -66,6 +62,10 @@ jobs:
pio run --environment ${{ matrix.target_name }}${{ matrix.target_build_type }} --target upload
echo "::endgroup::"
unzip -l './build/${{ matrix.target_name }}${{ matrix.target_build_type }}/*.zip'
- name: Archive Firmware name File
# create an environment variable with the name of the firmware file by catting the firmware_name.txt file
run: |
echo "FIRMWARE_NAME=$(cat ./ESP/tools/firmware_name.txt)" >> $GITHUB_ENV
- name: Archive Firmware Binaries
uses: actions/upload-artifact@v3
with:

View File

@ -1,17 +1,18 @@
#!/usr/bin/env python3
Import("env")
import os
import distro
print(distro.id())
import sys
from ntpath import basename
from zipfile import ZipFile
import json
def createZip(source, target, env):
if distro.id() == "ubuntu":
if (
sys.platform.startswith("ubuntu")
or sys.platform.startswith("Linux")
or sys.platform.startswith("linux")
):
print("Program has been built, creating zip archive!")
my_flags = env.ParseFlags(env["BUILD_FLAGS"])
defines = dict()