diff --git a/.github/workflows/Tasmota_build_devel.yml b/.github/workflows/Tasmota_build_devel.yml index 5e7d7145a..30502be32 100644 --- a/.github/workflows/Tasmota_build_devel.yml +++ b/.github/workflows/Tasmota_build_devel.yml @@ -1,12 +1,13 @@ + name: Build_development on: - workflow_dispatch: # Manually start a workflow + workflow_dispatch: # Manually start a workflow push: branches: development paths-ignore: - - '.github/**' # Ignore changes towards the .github directory - - '**.md' # Do no build if *.md files changes + - '.github/**' # Ignore changes towards the .github directory + - '**.md' # Do no build if *.md files changes # Ensures that only one deploy task per branch/environment will run at a time. concurrency: @@ -14,38 +15,13 @@ concurrency: cancel-in-progress: true jobs: - base-images: + safeboot-images: runs-on: ubuntu-latest if: github.repository == 'arendst/Tasmota' continue-on-error: true strategy: matrix: variant: - - tasmota - - tasmota4M - - tasmota-minimal - - tasmota-display - - tasmota-ir - - tasmota-knx - - tasmota-lite - - tasmota-sensors - - tasmota-zbbridge - - tasmota-zigbee - - tasmota32 - - tasmota32-zbbrdgpro - - tasmota32-webcam - - tasmota32-bluetooth - - tasmota32-nspanel - - tasmota32-display - - tasmota32-ir - - tasmota32-lvgl - - tasmota32c3 - - tasmota32c3cdc - - tasmota32s2 - - tasmota32s2cdc - - tasmota32s3 - - tasmota32s3cdc - - tasmota32solo1 - tasmota32solo1-safeboot - tasmota32-safeboot - tasmota32c3-safeboot @@ -68,12 +44,102 @@ jobs: pip install -U platformio - name: Run PlatformIO run: platformio run -e ${{ matrix.variant }} - - uses: actions/upload-artifact@v3 + - name: Upload safeboot firmware artifacts + uses: actions/upload-artifact@v3 + with: + name: firmware_safeboot + path: ./build_output + + base-images: + runs-on: ubuntu-latest + if: github.repository == 'arendst/Tasmota' + continue-on-error: true + strategy: + matrix: + variant: + - tasmota + - tasmota4M + - tasmota-minimal + - tasmota-display + - tasmota-ir + - tasmota-knx + - tasmota-lite + - tasmota-sensors + - tasmota-zbbridge + - tasmota-zigbee + steps: + - uses: actions/checkout@v3 + with: + ref: development + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install dependencies + run: | + pip install wheel + pip install -U platformio + - name: Run PlatformIO + run: platformio run -e ${{ matrix.variant }} + - name: Upload firmware artifacts + uses: actions/upload-artifact@v3 + with: + name: firmware + path: ./build_output + + base32-images: + needs: safeboot-images + runs-on: ubuntu-latest + if: github.repository == 'arendst/Tasmota' + continue-on-error: true + strategy: + matrix: + variant: + - tasmota32 + - tasmota32-zbbrdgpro + - tasmota32-webcam + - tasmota32-bluetooth + - tasmota32-nspanel + - tasmota32-display + - tasmota32-ir + - tasmota32-lvgl + - tasmota32c3 + - tasmota32c3cdc + - tasmota32s2 + - tasmota32s2cdc + - tasmota32s3 + - tasmota32s3cdc + - tasmota32solo1 + steps: + - uses: actions/checkout@v3 + with: + ref: development + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install dependencies + run: | + pip install wheel + pip install -U platformio + - name: Download safeboot firmwares + uses: actions/download-artifact@v3 + with: + name: firmware_safeboot + path: ./firmware + - name: Display downloaded files + run: | + ls -R ./firmware/ + - name: Run PlatformIO + run: platformio run -e ${{ matrix.variant }} + - name: Upload firmware artifacts + uses: actions/upload-artifact@v3 with: name: firmware path: ./build_output language-images: + needs: safeboot-images runs-on: ubuntu-latest if: github.repository == 'arendst/Tasmota' continue-on-error: true @@ -93,22 +159,37 @@ jobs: run: | pip install wheel pip install -U platformio + - name: Download safeboot firmwares + uses: actions/download-artifact@v3 + with: + name: firmware_safeboot + path: ./firmware + - name: Display downloaded files + run: | + ls -R ./firmware/ - name: Run PlatformIO run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }} - - uses: actions/upload-artifact@v3 + - name: Upload language firmware artifacts + uses: actions/upload-artifact@v3 with: name: firmware path: ./build_output Upload: - needs: [base-images, language-images] + needs: [base-images, base32-images, language-images] runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/download-artifact@v3 + - name: Download firmware + uses: actions/download-artifact@v3 with: name: firmware path: ./mv_firmware + - name: Downlaod safeboot firmware + uses: actions/download-artifact@v3 + with: + name: firmware_safeboot + path: ./mv_firmware - name: Display structure of downloaded files run: ls -R working-directory: ./mv_firmware @@ -159,7 +240,6 @@ jobs: destination_branch: 'firmware' user_email: 'github-actions@github.com' user_name: 'github-actions' - Start_final_copy: needs: Upload runs-on: ubuntu-latest diff --git a/.github/workflows/Tasmota_build_master.yml b/.github/workflows/Tasmota_build_master.yml index 133e4502c..e538a623f 100644 --- a/.github/workflows/Tasmota_build_master.yml +++ b/.github/workflows/Tasmota_build_master.yml @@ -1,11 +1,12 @@ name: Build_firmware_master on: + workflow_dispatch: # Manually start a workflow push: branches: master paths-ignore: - - '.github/**' # Ignore changes towards the .github directory - - '**.md' # Do no build if *.md files changes + - '.github/**' # Ignore changes towards the .github directory + - '**.md' # Do no build if *.md files changes # Ensures that only one deploy task per branch/environment will run at a time. concurrency: @@ -13,38 +14,13 @@ concurrency: cancel-in-progress: true jobs: - base-images: + safeboot-images: runs-on: ubuntu-latest if: github.repository == 'arendst/Tasmota' continue-on-error: true strategy: matrix: variant: - - tasmota - - tasmota4M - - tasmota-minimal - - tasmota-display - - tasmota-ir - - tasmota-knx - - tasmota-lite - - tasmota-sensors - - tasmota-zbbridge - - tasmota-zigbee - - tasmota32 - - tasmota32-zbbrdgpro - - tasmota32-webcam - - tasmota32-bluetooth - - tasmota32-nspanel - - tasmota32-display - - tasmota32-ir - - tasmota32-lvgl - - tasmota32c3 - - tasmota32c3cdc - - tasmota32s2 - - tasmota32s2cdc - - tasmota32s3 - - tasmota32s3cdc - - tasmota32solo1 - tasmota32solo1-safeboot - tasmota32-safeboot - tasmota32c3-safeboot @@ -67,12 +43,102 @@ jobs: pip install -U platformio - name: Run PlatformIO run: platformio run -e ${{ matrix.variant }} - - uses: actions/upload-artifact@v3 + - name: Upload safeboot firmware artifacts + uses: actions/upload-artifact@v3 + with: + name: firmware_safeboot + path: ./build_output + + base-images: + runs-on: ubuntu-latest + if: github.repository == 'arendst/Tasmota' + continue-on-error: true + strategy: + matrix: + variant: + - tasmota + - tasmota4M + - tasmota-minimal + - tasmota-display + - tasmota-ir + - tasmota-knx + - tasmota-lite + - tasmota-sensors + - tasmota-zbbridge + - tasmota-zigbee + steps: + - uses: actions/checkout@v3 + with: + ref: master + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install dependencies + run: | + pip install wheel + pip install -U platformio + - name: Run PlatformIO + run: platformio run -e ${{ matrix.variant }} + - name: Upload firmware artifacts + uses: actions/upload-artifact@v3 + with: + name: firmware + path: ./build_output + + base32-images: + needs: safeboot-images + runs-on: ubuntu-latest + if: github.repository == 'arendst/Tasmota' + continue-on-error: true + strategy: + matrix: + variant: + - tasmota32 + - tasmota32-zbbrdgpro + - tasmota32-webcam + - tasmota32-bluetooth + - tasmota32-nspanel + - tasmota32-display + - tasmota32-ir + - tasmota32-lvgl + - tasmota32c3 + - tasmota32c3cdc + - tasmota32s2 + - tasmota32s2cdc + - tasmota32s3 + - tasmota32s3cdc + - tasmota32solo1 + steps: + - uses: actions/checkout@v3 + with: + ref: master + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install dependencies + run: | + pip install wheel + pip install -U platformio + - name: Download safeboot firmwares + uses: actions/download-artifact@v3 + with: + name: firmware_safeboot + path: ./firmware + - name: Display downloaded files + run: | + ls -R ./firmware/ + - name: Run PlatformIO + run: platformio run -e ${{ matrix.variant }} + - name: Upload firmware artifacts + uses: actions/upload-artifact@v3 with: name: firmware path: ./build_output language-images: + needs: safeboot-images runs-on: ubuntu-latest if: github.repository == 'arendst/Tasmota' continue-on-error: true @@ -92,9 +158,18 @@ jobs: run: | pip install wheel pip install -U platformio + - name: Download safeboot firmwares + uses: actions/download-artifact@v3 + with: + name: firmware_safeboot + path: ./firmware + - name: Display downloaded files + run: | + ls -R ./firmware/ - name: Run PlatformIO run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }} - - uses: actions/upload-artifact@v3 + - name: Upload language firmware artifacts + uses: actions/upload-artifact@v3 with: name: firmware path: ./build_output @@ -112,7 +187,7 @@ jobs: - name: Display structure of downloaded files run: ls -R ./mv_firmware/ - name: Release - uses: softprops/action-gh-release@v1 + uses: jason2866/action-gh-release@v1.1 #if: startsWith(github.ref, 'refs/tags/') with: tag_name: ${{ github.run_number }} diff --git a/pio-tools/post_esp32.py b/pio-tools/post_esp32.py index 2ca0afc4f..3ded90386 100644 --- a/pio-tools/post_esp32.py +++ b/pio-tools/post_esp32.py @@ -33,15 +33,22 @@ import subprocess sys.path.append(join(platform.get_package_dir("tool-esptoolpy"))) import esptool +github_actions = os.getenv('GITHUB_ACTIONS') extra_flags = ''.join([element.replace("-D", " ") for element in env.BoardConfig().get("build.extra_flags", "")]) build_flags = ''.join([element.replace("-D", " ") for element in env.GetProjectOption("build_flags")]) if "CORE32SOLO1" in extra_flags or "FRAMEWORK_ARDUINO_SOLO1" in build_flags: FRAMEWORK_DIR = platform.get_package_dir("framework-arduino-solo1") + if github_actions and os.path.exists("./firmware/firmware"): + shutil.copytree("./firmware/firmware", "/home/runner/.platformio/packages/framework-arduino-solo1/variants/tasmota") elif "CORE32ITEAD" in extra_flags or "FRAMEWORK_ARDUINO_ITEAD" in build_flags: FRAMEWORK_DIR = platform.get_package_dir("framework-arduino-ITEAD") + if github_actions and os.path.exists("./firmware/firmware"): + shutil.copytree("./firmware/firmware", "/home/runner/.platformio/packages/framework-arduino-ITEAD/variants/tasmota") else: FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32") + if github_actions and os.path.exists("./firmware/firmware"): + shutil.copytree("./firmware/firmware", "/home/runner/.platformio/packages/framework-arduinoespressif32/variants/tasmota") variants_dir = join(FRAMEWORK_DIR, "variants", "tasmota")