mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-12 00:02:53 +00:00
* Added workflow to release RC versions * Added missing config to build file * Made S3 bucket configurable from repo * Updated release workflow
67 lines
1.9 KiB
YAML
67 lines
1.9 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- src/**
|
|
- lib/**
|
|
- scripts/**
|
|
- web/**
|
|
- platformio.ini
|
|
- .github/workflows/**
|
|
branches:
|
|
- '*'
|
|
tags:
|
|
- '*'
|
|
- '!v*.*.*'
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Check out code from repo
|
|
uses: actions/checkout@v4
|
|
- name: Inject secrets into ini file
|
|
run: |
|
|
sed -i 's/NO_AMS2MQTT_PRICE_KEY/AMS2MQTT_PRICE_KEY="${{secrets.AMS2MQTT_PRICE_KEY}}"/g' platformio.ini
|
|
sed -i 's/NO_AMS2MQTT_PRICE_AUTHENTICATION/AMS2MQTT_PRICE_AUTHENTICATION="${{secrets.AMS2MQTT_PRICE_AUTHENTICATION}}"/g' platformio.ini
|
|
sed -i 's/NO_AMS2MQTT_SC_KEY/AMS2MQTT_SC_KEY=\\"${{secrets.AMS2MQTT_SC_KEY}}\\"/g' platformio.ini
|
|
sed -i 's/NO_ENERGY_SPEEDOMETER_USER/ENERGY_SPEEDOMETER_USER=\\"${{secrets.ENERGY_SPEEDOMETER_USER}}\\"/g' platformio.ini
|
|
sed -i 's/NO_ENERGY_SPEEDOMETER_PASS/ENERGY_SPEEDOMETER_PASS=\\"${{secrets.ENERGY_SPEEDOMETER_PASS}}\\"/g' platformio.ini
|
|
- name: Cache Python dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('platformio.ini') }}
|
|
- name: Cache PlatformIO dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.pio/libdeps
|
|
key: ${{ runner.os }}-pio-${{ hashFiles('platformio.ini') }}
|
|
- name: Set up Python 3.9
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: 3.9
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -U platformio css_html_js_minify
|
|
- name: Set up node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '19.x'
|
|
- name: Build with node
|
|
run: |
|
|
cd lib/SvelteUi/app
|
|
npm ci
|
|
npm run build
|
|
cd -
|
|
env:
|
|
CI: true
|
|
- name: PlatformIO lib install
|
|
run: pio pkg install
|
|
- name: PlatformIO run
|
|
run: pio run
|