diff --git a/.github/workflows/build_esp32_dev_firmware.yml b/.github/workflows/build_esp32_dev_firmware.yml deleted file mode 100644 index c00640fa1..000000000 --- a/.github/workflows/build_esp32_dev_firmware.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Build ESP32 Dev Firmware - -on: - push: - branches: - - esp32_dev - tags: - # - '*.*.*' - paths: - - 'CHANGELOG_LATEST.md' - workflow_dispatch: - branches: [ esp32_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 esp32-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: esp32_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: ESP32 Development Build v${{steps.fetch_version.outputs.s}} - tag_name: esp32_dev - prerelease: true - files: | - ./build/firmware/*.* - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - diff --git a/.github/workflows/pre_release.yml b/.github/workflows/pre_release.yml new file mode 100644 index 000000000..b45a099f4 --- /dev/null +++ b/.github/workflows/pre_release.yml @@ -0,0 +1,59 @@ +name: "pre-release" + +on: + push: + branches: + - "dev" + +jobs: + pre-release: + + name: "Automatic pre-release build" + runs-on: ubuntu-latest + + steps: + + - name: Checkout source code + uses: actions/checkout@v2 + + - name: Get build variables + id: build_info + run: | + version=`grep -E '^#define EMSESP_APP_VERSION' ./src/version.h | awk -F'"' '{print $2}'` + echo "::set-output name=version::$version" + platform=`grep -E '^#define EMSESP_PLATFORM' ./src/version.h | awk -F'"' '{print $2}'` + echo "::set-output name=platform::$platform" + + - name: Compile locally + run: make + + - name: Setup Python + uses: actions/setup-python@v2 + + - name: Install pio + 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 firmware + run: | + platformio run -e ci + + - name: Release + id: "automatic_releases" + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + title: ${{steps.build_info.outputs.platform}} Development Build v${{steps.build_info.outputs.version}} + automatic_release_tag: "latest" + prerelease: true + files: | + CHANGELOG_DEV.md diff --git a/.github/workflows/release_esp32_stable.yml b/.github/workflows/release_esp32_stable.yml deleted file mode 100644 index 0e446e295..000000000 --- a/.github/workflows/release_esp32_stable.yml +++ /dev/null @@ -1,55 +0,0 @@ -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/standalone_build.yml b/.github/workflows/standalone_build.yml deleted file mode 100644 index 315963069..000000000 --- a/.github/workflows/standalone_build.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Standalone Build - -on: - push: - branches: [ esp32_dev ] - paths: - - 'src/**' - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: make clean - run: make clean - - - name: make - run: make - \ No newline at end of file diff --git a/.github/workflows/tagged_release.yml b/.github/workflows/tagged_release.yml new file mode 100644 index 000000000..e8287d26e --- /dev/null +++ b/.github/workflows/tagged_release.yml @@ -0,0 +1,56 @@ +name: "tagged-release" + +on: + push: + tags: + - "v*" + +jobs: + tagged-release: + + name: "Tagged Release" + runs-on: ubuntu-latest + + steps: + - name: Checkout source code + uses: actions/checkout@v2 + + - name: Get build variables + id: build_info + run: | + version=`grep -E '^#define EMSESP_APP_VERSION' ./src/version.h | awk -F'"' '{print $2}'` + echo "::set-output name=version::$version" + platform=`grep -E '^#define EMSESP_PLATFORM' ./src/version.h | awk -F'"' '{print $2}'` + echo "::set-output name=platform::$platform" + + - name: Compile locally + run: make + + - name: Setup Python + uses: actions/setup-python@v2 + + - name: Install pio + 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 firmware + run: | + platformio run -e ci + + - name: Release + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: false + files: | + CHANGELOG.md + ./build/firmware/*.* diff --git a/src/version.h b/src/version.h index c266689bc..f89aba31b 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1,2 @@ #define EMSESP_APP_VERSION "3.0.0b7" +#define EMSESP_PLATFORM "ESP32"