Skip to content

feature/lora: Enable LoraWAN supported hardware #1021

feature/lora: Enable LoraWAN supported hardware

feature/lora: Enable LoraWAN supported hardware #1021

Workflow file for this run

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Build/Release OpenEVSE
permissions:
contents: write
on:
workflow_dispatch:
inputs:
v1_ref:
required: true
description: The branch/tag for the v1 UI
default: master
v2_ref:
required: true
description: The branch/tag for the v2 UI
default: master
push:
branches:
- master
tags:
- 'v*'
pull_request:
jobs:
debug:
runs-on: ubuntu-latest
steps:
- name: Dump the environment
run: echo "Environment variables:" && env | sort
- name: Dump the event
run: cat $GITHUB_EVENT_PATH
- name: Dump github.ref_name
run: echo "github.ref_name = '${{ github.ref_name }}'"
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
env:
- openevse_nodemcu-32s
- openevse_esp-wrover-kit
- openevse_esp-wrover-kit_latest
- openevse_huzzah32_dev
- openevse_huzzah32
- openevse_featheresp32
- openevse_wifi_v1
- openevse_esp32-gateway-old
- openevse_esp32-gateway-e
- openevse_esp32-gateway-f
- openevse_esp32-gateway-e_dev
- openevse_esp32-gateway-f_dev
- openevse_esp32-poe-iso
- openevse_esp32-heltec-wifi-lora-v2
gui:
- name: gui-v1
repo: OpenEVSE/openevse_wifi_gui
build_flags: ""
ref: ${{ inputs.v1_ref }}
- name: gui-v2
repo: KipK/openevse-gui-v2
build_flags: "-D DISABLE_WIFI_PORTAL -D WEB_SERVER_ROOT_PAGE_INDEX"
ref: ${{ inputs.v2_ref }}
steps:
- uses: ammaraskar/gcc-problem-matcher@master
- uses: actions/checkout@v3
- name: Checkout GUI
uses: actions/checkout@v3
with:
repository: ${{ matrix.gui.repo }}
path: ${{ matrix.gui.name }}
ref: ${{ matrix.gui.ref }}
submodules: recursive
- 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: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Set up Node JS
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: |
cd ${{ matrix.gui.name }}
npm install
- name: Build GUI
run: |
cd ${{ matrix.gui.name }}
npm run build
- name: Run PlatformIO
run: pio run -e ${{ matrix.env }}
env:
GUI_NAME: ${{ matrix.gui.name }}
PLATFORMIO_BUILD_FLAGS: ${{ matrix.gui.build_flags }}
- name: Upload output to GitHub
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.env }}_${{ matrix.gui.name }}.bin
path: .pio/build/${{ matrix.env }}/firmware.bin
release:
runs-on: ubuntu-latest
needs: build
if: github.ref_name == 'master' || startsWith(github.ref_name, 'v')
steps:
- name: Download the built assets
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Rename images to something more sensible
run: |
find artifacts -name 'firmware.bin' | while read -r image; do
dir=$(dirname "${image}")
board=$(basename "${dir}")
echo mv "$image" "$board"
mv "$image" "$board"
done
- name: Upload assets to latest release
if: github.ref_name == 'master'
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: latest
prerelease: true
title: Development Build
files: |
*gui-v1.bin
- name: Upload assets to the v2 GUI release
if: github.ref_name == 'master'
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: v2_gui
prerelease: true
title: V2 GUI pre-release
files: |
*gui-v2.bin
- name: Upload assets to release
if: startsWith(github.ref_name, 'v')
uses: "softprops/action-gh-release@v1"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
title: "${{ github.ref_name }}"
files: |
*.bin