Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 48 additions & 35 deletions .github/workflows/build_latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
branches:
- main
- develop
paths:
- '.github/**'
- 'config/satellite*'
pull_request:
workflow_dispatch:
release:
Expand All @@ -17,54 +14,70 @@ env:
DEFAULT_PYTHON: "3.9"

jobs:
build-list-all:
build-list:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
build_firmware: ${{ steps.final_list.outputs.build_firmware }}
build_cfg_files: ${{ steps.final_list.outputs.files }}
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
uses: actions/[email protected]

- name: Find all YAML satellite files
id: set-matrix
run: echo "matrix=$(ls config/satellite*.yaml | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT

build-list:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.convert_to_list.outputs.matrix }}
any_changed: ${{ steps.changed-satellite-files.outputs.any_changed }}
files: ${{ steps.changed-satellite-files.outputs.all_changed_files }}
steps:
- name: Get all changed satellite files
id: changed-satellite-files
id: all-satellite-files
run: |
echo "matrix=$(ls config/satellite*.yaml | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
echo "all_files=$(ls config/satellite*.yaml | jq --slurp --raw-input )" >> $GITHUB_OUTPUT

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
# Avoid using single or double quotes for multiline patterns
files: |
config/satellite*.yaml
- name: convert to new line separated string
id: convert_to_list
files_yaml: |
core:
- config/satellite*.yaml
includes:
- config/common/*.yaml

- name: create actual list
id: final_list
env:
CHANGED_FILES: ${{ steps.changed-satellite-files.outputs.all_changed_files }}
INCLUDES_CHANGED: ${{ steps.changed-files.outputs.includes_any_changed }}
CORE_HAS_CHANGED: ${{ steps.changed-files.outputs.core_any_changed }}
CHANGED_CORE_FILES: ${{ steps.changed-files.outputs.core_all_changed_files }}

run: |
ARR=()
for file in ${CHANGED_FILES}; do
echo "$file was changed"
ARR+=($file)
done
echo "matrix=$( printf '%s\n' "${ARR[@]}" | jq --slurp --raw-input)" >> $GITHUB_OUTPUT

build-firmware-changed:
if: needs.build-list.outputs.any_changed == 'True'
if [[ ${INCLUDES_CHANGED} == "true" ]]; then
echo "build_firmware=true" >> $GITHUB_OUTPUT
echo "matrix=$(ls config/satellite*.yaml | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
echo "files=$(ls config/satellite*.yaml | jq --slurp --raw-input )" >> $GITHUB_OUTPUT
elif [[ ${CORE_HAS_CHANGED} == "true" ]]; then
ARR=()
for file in ${CHANGED_CORE_FILES}; do
echo "$file was changed"
ARR+=($file)
done
echo "build_firmware=true" >> $GITHUB_OUTPUT
echo "matrix=$( printf '%s\n' "${ARR[@]}" | jq --slurp --raw-input)" >> $GITHUB_OUTPUT
echo "files=$( printf '%s\n' "${ARR[@]}" | jq --slurp --raw-input)" >> $GITHUB_OUTPUT
else
echo "build_firmware=false" >> $GITHUB_OUTPUT
echo "matrix=''" >> $GITHUB_OUTPUT
echo "files=''" >> $GITHUB_OUTPUT
fi

build-firmware:
if: needs.build-list.outputs.build_firmware == 'true'
name: Build Firmware
needs:
- build-list

uses: esphome/workflows/.github/workflows/build.yml@main
with:
files: ${{ fromJSON(needs.build-list.outputs.matrix) }}
files: ${{ fromJSON(needs.build-list.outputs.build_cfg_files) }}
esphome-version: 2024.6.0
release-summary: ${{ github.event_name == 'release' && github.event.release.body || '' }}
release-url: ${{ github.event_name == 'release' && github.event.release.html_url || '' }}
release-version: ${{ github.event_name == 'release' && github.event.release.tag_name || '' }}



1 change: 1 addition & 0 deletions config/common/everloop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ light:
max_brightness: 100%



script:
# Script controlling the LED, based on different conditions:
# - initialization in progress,
Expand Down
1 change: 1 addition & 0 deletions config/satellite_va_core_r1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ substitutions:
core_revision: "1"
LED_PIN: "GPIO5"


packages:
device_base: !include common/board.yaml
wifi: !include common/wifi_improv.yaml
Expand Down
1 change: 1 addition & 0 deletions config/satellite_va_core_r2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ substitutions:
core_revision: "2"
LED_PIN: "GPIO14"


packages:
device_base: !include common/board.yaml
wifi: !include common/wifi_improv.yaml
Expand Down