Skip to content

Workflow file for this run

on:
push:
# branches:
# - "master"
workflow_dispatch:
jobs:
get-envs:
name: Get environments
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install PlatformIO
run: pip install platformio
- name: Get default environments
id: envs
run: |
echo "environments=$(pio project config --json-output | jq -cr '.[0] | select(.[0] == "platformio")[1][] | select(.[0] == "default_envs")[1]')" >> $GITHUB_OUTPUT
outputs:
environments: ${{ steps.envs.outputs.environments }}
build:
name: build ${{ matrix.environment }}
needs: get-envs
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
environment: ${{ fromJSON(needs.get-envs.outputs.environments) }}
steps:
- uses: actions/checkout@v4
- 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
./pio
key: ${{ runner.os }}-pio-${{ matrix.environment }}-${{ hashFiles('**/platformio.ini') }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install PlatformIO
run: pip install -r requirements.txt
- name: Build firmware
env:
PUBLISH: true
run: pio run -e ${{ matrix.environment }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.environment }}
path: publish/${{ matrix.environment }}
publish:
name: Publish binaries
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- uses: actions/configure-pages@v3
- uses: actions/jekyll-build-pages@v1
with:
destination: ./output
- run: mkdir -p ./output/publish
- uses: actions/download-artifact@v3
with:
path: ./output/publish
- name: merge manifests
run: |
jq -s '[.[] | select(.name == "ATEM_tally_light")] | (.[0] | with_entries(select(.key != "builds"))) + {builds: map(.builds) | add}' ./output/publish/*/manifest.json > ./output/ATEM_tally_light_manifest.json &&
jq -s '[.[] | select(.name == "ATEM_tally_test_server")] | (.[0] | with_entries(select(.key != "builds"))) + {builds: map(.builds) | add}' ./output/publish/*/manifest.json > ./output/ATEM_tally_test_server_manifest.json
- uses: actions/upload-pages-artifact@v2
with:
name: gh-page-mine
path: ./output