diff --git a/.ci/firmware.json b/.ci/firmware.json deleted file mode 100644 index 6e00cd7aa..000000000 --- a/.ci/firmware.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "release": "ESPixelStick 4.0-dev - UNTESTED CI BUILD", - "baudrate": "115200", - "boards": [ - { - "name": "ESPixelStick V3", - "description": "Official hardware from Forkineye", - "chip": "esp8266", - "appbin": "esp8266/espsv3-app.bin", - "esptool": { - "baudrate": "460800", - "options": "--before default_reset --after hard_reset", - "flashcmd": "write_flash" - }, - "binfiles": [ - { - "name": "esp8266/espsv3-app.bin", - "offset": "0x0" - } - ], - "filesystem": { - "page": "256", - "block": "8192", - "size": "2072576", - "offset": "0x200000" - } - }, - { - "name": "Wemos D1 Mini", - "description": "Generic Wemos D1 Mini for DIY builds", - "chip": "esp8266", - "appbin": "esp8266/d1_mini-app.bin", - "esptool": { - "baudrate": "460800", - "options": "--before default_reset --after hard_reset", - "flashcmd": "write_flash" - }, - "binfiles": [ - { - "name": "esp8266/d1_mini-app.bin", - "offset": "0x0" - } - ], - "filesystem": { - "page": "256", - "block": "8192", - "size": "2072576", - "offset": "0x200000" - } - }, - { - "name": "Lolin D32 Pro", - "description": "Lolin D32 Pro module with PSRAM support for DIY builds", - "chip": "esp32", - "appbin": "esp32/d32_pro-app.bin", - "esptool": { - "baudrate": "460800", - "options": "--before default_reset --after hard_reset", - "flashcmd": "write_flash -z" - }, - "binfiles": [ - { - "name": "esp32/d32_pro-bootloader.bin", - "offset": "0x1000" - }, - { - "name": "esp32/d32_pro-partitions.bin", - "offset": "0x8000" - }, - { - "name": "esp32/boot_app0.bin", - "offset": "0xe000" - }, - { - "name": "esp32/d32_pro-app.bin", - "offset": "0x10000" - } - ], - "filesystem": { - "page": "256", - "block": "4096", - "size": "0x30000", - "offset": "0x3D0000" - } - }, - { - "name": "Generic ESP32 4MB", - "description": "Generic ESP32 with 4MB flash layout for DIY builds", - "chip": "esp32", - "appbin": "esp32/d1_mini32-app.bin", - "esptool": { - "baudrate": "460800", - "options": "--before default_reset --after hard_reset", - "flashcmd": "write_flash -z" - }, - "binfiles": [ - { - "name": "esp32/d1_mini32-bootloader.bin", - "offset": "0x1000" - }, - { - "name": "esp32/d1_mini32-partitions.bin", - "offset": "0x8000" - }, - { - "name": "esp32/boot_app0.bin", - "offset": "0xe000" - }, - { - "name": "esp32/d1_mini32-app.bin", - "offset": "0x10000" - } - ], - "filesystem": { - "page": "256", - "block": "4096", - "size": "0x30000", - "offset": "0x3D0000" - } - } - ] -} \ No newline at end of file diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ecc399490..d5a0de73f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,11 +28,10 @@ jobs: mkdir firmware echo "CI-$GITHUB_RUN_ID" > firmware/VERSION - - name: Tagged release - if: startsWith(github.ref, 'refs/tags/') + - name: Tagged version release + if: startsWith(github.ref, 'refs/tags/v') run: | - echo "${{ github.ref }}" > firmware/VERSION - echo "ESPS_RELEASE" >> $GITHUB_ENV + echo "${GITHUB_REF#refs/*/v}" > firmware/VERSION - name: Create secrets.h run: | @@ -85,23 +84,17 @@ jobs: package: + name: Create Package needs: firmware runs-on: ubuntu-latest steps: - # Set Release Archive Filename - # - run: | - # if [ -z "$ESPS_RELEASE" ]; then - # echo "ARCHFILE=ESPixelStick_CI-$GITHUB_RUN_ID.zip" >> $GITHUB_ENV - # else - # echo "ARCHFILE=ESPixelStick_Firmware-$ESPS_RELEASE.zip" >> $GITHUB_ENV - # fi - # Checkout ESPixelStick - uses: actions/checkout@v2 - - name: Tagged release - if: startsWith(github.ref, 'refs/tags/') - run: echo "ESPS_RELEASE" >> $GITHUB_ENV + - name: Set release flag + if: startsWith(github.ref, 'refs/tags/v') + run: | + echo "ESPS_RELEASE=''" >> $GITHUB_ENV # Download firmware binary artifact - uses: actions/download-artifact@v2 @@ -120,21 +113,19 @@ jobs: run: | gulp gulp md + if [ -z "$ESPS_RELEASE" ]; then gulp ci + fi mv ESPixelStick/data/* dist/fs - name: Set release archive filename - run: echo "ARCHFILE=ESPixelStick_Firmware-`cat dist/firmware/VERSION`.zip" >> $GITHUB_ENV + run: | + _VERSION=$(< dist/firmware/VERSION) + echo "ARCHFILE=ESPixelStick_Firmware-${_VERSION}.zip" >> $GITHUB_ENV - name: Update firmware.json run: python .scripts/ci-firmware.py - - name: Move CI specific release files into place - run: | - if [ -z "$ESPS_RELEASE" ]; then - mv .ci/firmware.json dist/firmware/firmware.json - fi - - name: Create Release Archive run: zip -r ../${{ env.ARCHFILE }} * working-directory: dist @@ -144,9 +135,19 @@ jobs: with: name: Release Archive path: ${{ env.ARCHFILE }} - - # - name: Release - # uses: softprops/action-gh-release@v1 - # if: startsWith(github.ref, 'refs/tags/') - # with: - # files: ${{ env.ARCHFILE }} \ No newline at end of file + + release: + needs: package + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + steps: + - name: Download Package + uses: actions/download-artifact@v2 + with: + name: Release Archive + - name: Create Draft Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + draft: true + files: ESPixelStick_Firmware*.zip \ No newline at end of file diff --git a/.scripts/ci-firmware.py b/.scripts/ci-firmware.py index 7be505920..d66f6464c 100644 --- a/.scripts/ci-firmware.py +++ b/.scripts/ci-firmware.py @@ -8,17 +8,12 @@ version = file.readline().rstrip() file.close -if RELEASE in os.environ: - with open("dist/firmware.json", "r+") as file: - data = json.load(file) +with open("dist/firmware/firmware.json", "r+") as file: + data = json.load(file) + if RELEASE in os.environ: data["release"] = f"ESPixelStick {version}" - file.seek(0) - json.dump(data, file) - file.truncate() -else: - with open(".ci/firmware.json", "r+") as file: - data = json.load(file) - data["release"] = f"ESPixelStick CI Build #{version}" - file.seek(0) - json.dump(data, file) - file.truncate() \ No newline at end of file + else: + data["release"] = f"ESPixelStick Build #{version} (untested)" + file.seek(0) + json.dump(data, file) + file.truncate() \ No newline at end of file