Build binaries, docs and publish to dev folder #277
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: Build binaries, docs and publish to dev folder | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
build-upload: | |
runs-on: ubuntu-latest | |
if: github.repository_owner == '1technophile' | |
name: Build and upload Assets to Release | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: benjlevesque/[email protected] | |
id: short-sha | |
with: | |
length: 6 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.7" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install platformio requests shutils | |
npm install | |
- name: Set sha tag | |
run: | | |
sed -i "s/version_tag/${{ steps.short-sha.outputs.sha }}/g" main/User_config.h scripts/latest_version_dev.json | |
sed -i "s/version_tag/DEVELOPMENT SHA:${{ steps.short-sha.outputs.sha }} TEST ONLY/g" docs/.vuepress/config.js | |
sed -i "s|base: '/'|base: '/dev/'|g" docs/.vuepress/config.js | |
- name: Extract ESP32 platform version from platformio.ini | |
run: | | |
ESP32_VERSION=$(grep 'esp32_platform\s*=' platformio.ini | cut -d'@' -f2 | tr -d '[:space:]') | |
echo "ESP32_PLATFORM_VERSION=${ESP32_VERSION}" >> $GITHUB_ENV | |
- name: Trigger framework installation | |
run: platformio run -e esp32dev-all-test | |
- name: Replace libbtdm_app.a file | |
run: cp lib/esp32-bt-lib/esp32/libbtdm_app.a $HOME/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/ld/libbtdm_app.a | |
- name: Verify file replacement | |
run: | | |
echo "Listing the file at the target location:" | |
ls -ltr $HOME/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/ld/ | |
echo "Checking file checksum:" | |
md5sum $HOME/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/ld/libbtdm_app.a | |
- name: Run PlatformIO | |
run: | | |
export PLATFORMIO_BUILD_FLAGS="'-DDEVELOPMENTOTA=true'" | |
platformio run | |
- name: Prepare Release Assets | |
run: | | |
sudo apt install rename | |
./scripts/prepare_deploy.sh | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "14.x" | |
- name: Build documentation | |
run: | | |
python ./scripts/gen_wu_dev.py | |
npm run docs:build | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/.vuepress/dist | |
destination_dir: dev | |
cname: docs.openmqttgateway.com |