WLED compile #25
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: WLED compile | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install PlatformIO | |
run: | | |
python -m pip install --upgrade pip | |
pip install --upgrade platformio | |
- name: Run PlatformIO | |
run: | | |
rm -rf /tmp/WLEDtemp/* || true | |
mkdir -p /tmp/WLEDtemp | |
wget https://github.com/moonmodules/WLED/archive/refs/heads/mdev.zip -O /tmp/WLEDtemp/mm.zip | |
unzip /tmp/WLEDtemp/mm.zip -d /tmp/WLEDtemp | |
find /tmp/WLEDtemp -maxdepth 1 -mindepth 1 -name "*" -type d >> /tmp/WLEDtemp/wledfoldername | |
cd `cat /tmp/WLEDtemp/wledfoldername` | |
echo '[env:custom_build]' >>platformio.ini | |
echo 'extends = env:esp32_4MB_M' >>platformio.ini | |
echo 'build_flags = ${env:esp32_4MB_M.build_flags} -D USERMOD_DHT -D USERMOD_DHT_CELSIUS -D USERMOD_MULTI_RELAY -D USERMOD_PIRSWITCH -D USERMOD_SN_PHOTORESISTOR' >>platformio.ini | |
echo 'lib_deps = ' >>platformio.ini | |
echo ' ${env:esp32_4MB_M.lib_deps}' >>platformio.ini | |
echo ' https://github.com/alwynallan/DHT_nonblocking' >>platformio.ini | |
pio run -e custom_build || pio run -e custom_build | |
- name: Copy Files | |
run: | | |
cd $GITHUB_WORKSPACE | |
git rm -r $GITHUB_WORKSPACE/*.bin || true | |
WLEDFOLDERNAME=`cat /tmp/WLEDtemp/wledfoldername` | |
cp ${WLEDFOLDERNAME}/build_output/firmware/custom_build.bin $GITHUB_WORKSPACE/ | |
date -I | tr -d '\n' >$GITHUB_WORKSPACE/last_update_date.txt | |
- name: Commit Files | |
run: | | |
cd $GITHUB_WORKSPACE | |
git config user.name "GitHub Actions Bot" | |
git config user.email "<>" | |
git add $GITHUB_WORKSPACE/custom_build.bin | |
git add $GITHUB_WORKSPACE/last_update_date.txt | |
git commit -m "Commit Custom Build" | |
git push origin main |