From 40e22038f7dd9f34f88516af125e4c9910023351 Mon Sep 17 00:00:00 2001 From: proddy Date: Sun, 21 Feb 2021 11:52:45 +0100 Subject: [PATCH] workflow changes --- ...mware.yml => build_esp32_dev_firmware.yml} | 15 ++-- .../workflows/build_esp8266_dev_firmware.yml | 72 +++++++++++++++++++ .github/workflows/release_esp32_stable.yml | 55 ++++++++++++++ ...se_main.yml => release_esp8266_stable.yml} | 7 +- .github/workflows/standalone_build.yml | 2 +- 5 files changed, 139 insertions(+), 12 deletions(-) rename .github/workflows/{build_firmware.yml => build_esp32_dev_firmware.yml} (86%) create mode 100644 .github/workflows/build_esp8266_dev_firmware.yml create mode 100644 .github/workflows/release_esp32_stable.yml rename .github/workflows/{release_main.yml => release_esp8266_stable.yml} (89%) diff --git a/.github/workflows/build_firmware.yml b/.github/workflows/build_esp32_dev_firmware.yml similarity index 86% rename from .github/workflows/build_firmware.yml rename to .github/workflows/build_esp32_dev_firmware.yml index 79e0e4ecc..c00640fa1 100644 --- a/.github/workflows/build_firmware.yml +++ b/.github/workflows/build_esp32_dev_firmware.yml @@ -1,13 +1,15 @@ -name: Build Firmware +name: Build ESP32 Dev Firmware on: push: branches: - - dev + - esp32_dev tags: # - '*.*.*' paths: - 'CHANGELOG_LATEST.md' + workflow_dispatch: + branches: [ esp32_dev ] jobs: @@ -41,7 +43,6 @@ jobs: - name: Build images run: | - platformio run -e esp8266-ci platformio run -e esp32-ci - name: Delete @@ -49,7 +50,7 @@ jobs: # if: startsWith(github.ref, 'refs/tags/') with: delete_release: true - tag_name: dev + tag_name: esp32_dev env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -61,11 +62,11 @@ jobs: # if: startsWith(github.ref, 'refs/tags/') with: body_path: BODY.txt - name: Development Build v${{steps.fetch_version.outputs.s}} - tag_name: dev + name: ESP32 Development Build v${{steps.fetch_version.outputs.s}} + tag_name: esp32_dev prerelease: true files: | ./build/firmware/*.* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - \ No newline at end of file + diff --git a/.github/workflows/build_esp8266_dev_firmware.yml b/.github/workflows/build_esp8266_dev_firmware.yml new file mode 100644 index 000000000..baa3eb5dc --- /dev/null +++ b/.github/workflows/build_esp8266_dev_firmware.yml @@ -0,0 +1,72 @@ +name: Build ESP8266 Dev Firmware + +on: + push: + branches: + - esp8266_dev + tags: + # - '*.*.*' + paths: + - 'CHANGELOG_LATEST.md' + workflow_dispatch: + branches: [ esp8266_dev ] + +jobs: + + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Version + id: fetch_version + run: | + version=`grep -E '^#define EMSESP_APP_VERSION' ./src/version.h | awk '{print $3}' | sed 's/"//g'` + echo "::set-output name=s::$version" + + - name: Setup Python + uses: actions/setup-python@v1 + + - name: Install + run: | + python -m pip install --upgrade pip + pip install -U platformio + platformio upgrade + platformio update + + - name: Build web + run: | + cd interface + npm install + npm run build + + - name: Build images + run: | + platformio run -e esp8266-ci + + - name: Delete + uses: dev-drprasad/delete-tag-and-release@v0.1.2 + # if: startsWith(github.ref, 'refs/tags/') + with: + delete_release: true + tag_name: esp8266_dev + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Changelog + run: cat RELEASENOTES_DEV.md CHANGELOG_LATEST.md > BODY.txt + + - name: Release + uses: softprops/action-gh-release@v1 + # if: startsWith(github.ref, 'refs/tags/') + with: + body_path: BODY.txt + name: ESP8266 Development Build v${{steps.fetch_version.outputs.s}} + tag_name: esp8266_dev + prerelease: true + files: | + ./build/firmware/*.* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.github/workflows/release_esp32_stable.yml b/.github/workflows/release_esp32_stable.yml new file mode 100644 index 000000000..0e446e295 --- /dev/null +++ b/.github/workflows/release_esp32_stable.yml @@ -0,0 +1,55 @@ +name: Release Stable ESP32 + +on: + workflow_dispatch: + branches: [ stable_esp32 ] + +jobs: + + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Version + id: fetch_version + run: | + version=`grep -E '^#define EMSESP_APP_VERSION' ./src/version.h | awk '{print $3}' | sed 's/"//g'` + echo "::set-output name=s::$version" + + - name: Setup Python + uses: actions/setup-python@v1 + + - name: Install + run: | + python -m pip install --upgrade pip + pip install -U platformio + platformio upgrade + platformio update + + - name: Build web + run: | + cd interface + npm install + npm run build + + - name: Build images + run: | + platformio run -e esp32-ci + + - name: Changelog + run: cat RELEASENOTES.md CHANGELOG_LATEST.md > BODY.txt + + - name: Release + uses: softprops/action-gh-release@v1 + with: + body_path: BODY.txt + name: EMS-ESP v${{steps.fetch_version.outputs.s}} (ESP32) + tag_name: v${{steps.fetch_version.outputs.s}} + prerelease: false + files: | + ./build/firmware/*.* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + \ No newline at end of file diff --git a/.github/workflows/release_main.yml b/.github/workflows/release_esp8266_stable.yml similarity index 89% rename from .github/workflows/release_main.yml rename to .github/workflows/release_esp8266_stable.yml index c43c0cda4..8d83004ca 100644 --- a/.github/workflows/release_main.yml +++ b/.github/workflows/release_esp8266_stable.yml @@ -1,8 +1,8 @@ -name: Release Main +name: Release Stable ESP8266 on: workflow_dispatch: - branches: [ main ] + branches: [ stable_esp8266 ] jobs: @@ -37,7 +37,6 @@ jobs: - name: Build images run: | platformio run -e esp8266-ci - platformio run -e esp32-ci - name: Changelog run: cat RELEASENOTES.md CHANGELOG_LATEST.md > BODY.txt @@ -46,7 +45,7 @@ jobs: uses: softprops/action-gh-release@v1 with: body_path: BODY.txt - name: EMS-ESP v${{steps.fetch_version.outputs.s}} + name: EMS-ESP v${{steps.fetch_version.outputs.s}} (ESP8266) tag_name: v${{steps.fetch_version.outputs.s}} prerelease: false files: | diff --git a/.github/workflows/standalone_build.yml b/.github/workflows/standalone_build.yml index 0b5379398..315963069 100644 --- a/.github/workflows/standalone_build.yml +++ b/.github/workflows/standalone_build.yml @@ -2,7 +2,7 @@ name: Standalone Build on: push: - branches: [ dev ] + branches: [ esp32_dev ] paths: - 'src/**'