You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

163 lines
4.1 KiB

name: Ahoy Dev-Build for ESP8266/ESP32
on:
push:
branches: development*
paths-ignore:
- '**.md' # Do no build on *.md changes
jobs:
check:
runs-on: ubuntu-latest
if: github.repository == 'lumapu/ahoy' && github.ref_name == 'development03'
continue-on-error: true
steps:
- uses: actions/checkout@v3
build-en:
needs: check
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
variant:
- esp8266
- esp8266-prometheus
- esp8285
- esp32-wroom32
- esp32-wroom32-prometheus
- esp32-wroom32-ethernet
- esp32-s2-mini
- esp32-c3-mini
- opendtufusion
- opendtufusion-ethernet
steps:
- uses: actions/checkout@v3
- 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 -e ${{ matrix.variant }}
build-de:
needs: check
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
variant:
- esp8266-de
- esp8266-prometheus-de
- esp8285-de
- esp32-wroom32-de
- esp32-wroom32-prometheus-de
- esp32-wroom32-ethernet-de
- esp32-s2-mini-de
- esp32-c3-mini-de
- opendtufusion-de
- opendtufusion-ethernet-de
steps:
- uses: actions/checkout@v3
- uses: benjlevesque/short-sha@v2.1
id: short-sha
with:
length: 7
2 years ago
- name: Cache Pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
2 years ago
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
2 years ago
- name: Setup Python
uses: actions/setup-python@v4.3.0
with:
python-version: "3.x"
2 years ago
- name: Install PlatformIO
run: |
python -m pip install setuptools --upgrade pip
pip install --upgrade platformio
2 years ago
- name: Run PlatformIO
run: pio run -d src -e ${{ matrix.variant }}
2 years ago
deploy:
needs: [build-en, build-de]
runs-on: ubuntu-latest
steps:
- name: Copy boot_app0.bin
run: cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin src/.pio/build/opendtufusion/ota.bin
2 years ago
2 years ago
- name: Rename Binary files
id: rename-binary-files
working-directory: src
2 years ago
run: python ../scripts/getVersion.py >> $GITHUB_OUTPUT
2 years ago
- name: Set Version
uses: cschleiden/replace-tokens@v1
with:
files: tools/esp8266/User_Manual.md
env:
VERSION: ${{ steps.rename-binary-files.outputs.name }}
2 years ago
2 years ago
- name: Create Manifest
working-directory: src
2 years ago
run: python ../scripts/buildManifest.py
2 years ago
2 years ago
- name: Create Artifact
2 years ago
uses: actions/upload-artifact@v3
with:
name: ahoydtu_dev
2 years ago
path: |
src/firmware/*
src/User_Manual.md
src/install.html
2 years ago
- 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 }}/dev
port: ${{ secrets.FW_SSH_PORT }}
user: ${{ secrets.FW_SSH_USER }}
key: ${{ secrets.FW_SSH_KEY }}