0.8.34 release #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Ahoy Release for ESP8266/ESP32 | |
on: | |
push: | |
branches: main | |
paths: | |
- 'src/**' # build only when changes occur here | |
- '.github/workflows/compile_release.yml' | |
- '!README.md' | |
- '!CHANGES.md' | |
- '!User_Manual.md' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: benjlevesque/short-sha@v2.1 | |
id: short-sha | |
with: | |
length: 7 | |
- name: Cache Pip | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Cache PlatformIO | |
uses: actions/cache@v3 | |
with: | |
path: ~/.platformio | |
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | |
- name: Setup Python | |
uses: actions/setup-python@v4.3.0 | |
with: | |
python-version: "3.x" | |
- name: Install PlatformIO | |
run: | | |
python -m pip install setuptools --upgrade pip | |
pip install --upgrade platformio | |
- name: Run PlatformIO | |
run: pio run -d src --environment esp8266 --environment esp8266-prometheus --environment esp8285 --environment esp32-wroom32 --environment esp32-wroom32-prometheus --environment esp32-wroom32-ethernet --environment esp32-s2-mini --environment esp32-c3-mini --environment opendtufusion --environment opendtufusion-ethernet | |
- name: Copy boot_app0.bin | |
run: cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin src/.pio/build/opendtufusion/ota.bin | |
- name: Rename Binary files | |
id: rename-binary-files | |
working-directory: src | |
run: python ../scripts/getVersion.py >> $GITHUB_OUTPUT | |
- name: Create Release | |
id: create-release | |
uses: actions/create-release@v1 | |
with: | |
draft: false | |
prerelease: false | |
release_name: ${{ steps.rename-binary-files.outputs.name }} | |
tag_name: ${{ steps.rename-binary-files.outputs.name }} | |
body_path: src/CHANGES.md | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Set Version | |
uses: cschleiden/replace-tokens@v1 | |
with: | |
files: User_Manual.md | |
env: | |
VERSION: ${{ steps.rename-binary-files.outputs.name }} | |
- name: Create Artifact | |
run: zip --junk-paths ${{ steps.rename-binary-files.outputs.name }}.zip src/firmware/* rc/firmware/s3/* User_Manual.md | |
- name: Upload Release | |
id: upload-release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: ./${{ steps.rename-binary-files.outputs.name }}.zip | |
asset_name: ${{ steps.rename-binary-files.outputs.name }}.zip | |
asset_content_type: application/zip | |
- name: Rename firmware directory | |
run: mv src/firmware src/${{ steps.rename-binary-files.outputs.name }} | |
- name: Deploy | |
uses: nogsantos/scp-deploy@master | |
with: | |
src: src/${{ steps.rename-binary-files.outputs.name }}/ | |
host: ${{ secrets.FW_SSH_HOST }} | |
remote: ${{ secrets.FW_SSH_DIR }}/release | |
port: ${{ secrets.FW_SSH_PORT }} | |
user: ${{ secrets.FW_SSH_USER }} | |
key: ${{ secrets.FW_SSH_KEY }} |