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
9 changes: 4 additions & 5 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name-template: 'Release v$NEXT_PATCH_VERSION'
tag-template: "$RESOLVED_VERSION"
change-template: "- #$NUMBER $TITLE @$AUTHOR"
sort-direction: ascending
category-template: '**$TITLE**'

categories:
- title: "🚨 Breaking changes"
Expand All @@ -25,11 +26,9 @@ include-labels:

no-changes-template: '- No changes'

# The shared build workflow appends a Full Changelog compare link to the
# release body (release-drafter cannot render 4-part version tags).
template: |
## What's Changed
**What's Changed**

$CHANGES

**Full Changelog**: https://github.com/ApolloAutomation/MSR-2/compare/$PREVIOUS_TAG...$RESOLVED_VERSION.1

Be sure to 🌟 this repository for updates!
7 changes: 4 additions & 3 deletions .github/workflows/autoassign.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Auto Assign

# pull_request_target (not pull_request) so auto-assign works on
# fork-submitted PRs; fork pull_request runs only get a read-only token.
# Safe because this workflow never checks out or executes PR code.
on:
issues:
types: [opened]
pull_request:
pull_request_target:
Comment thread
coderabbitai[bot] marked this conversation as resolved.
types: [opened]

permissions:
Expand All @@ -12,8 +15,6 @@ permissions:

jobs:
auto-assign:
# Skip auto-assign for pull requests from forks due to GITHUB_TOKEN permission restrictions
if: github.event_name == 'issues' || github.event.pull_request.head.repo.full_name == github.repository
uses: ApolloAutomation/Workflows/.github/workflows/autoassign.yml@main
with:
assignees: bharvey88
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/build-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Build and Publish Beta

# Builds MSR-2 firmware from the beta branch and publishes it as assets on a
# rolling "beta-fw" pre-release. The on-device "Firmware Channel" select points
# OTA updates at these assets. Stable firmware is built/published separately
# by build.yml (push to main -> GitHub Pages).

on:
push:
branches: [beta]
paths:
- 'Integrations/ESPHome/**'
workflow_dispatch:

# Least privilege: read-only by default; only publish-beta is elevated to write.
permissions:
contents: read

jobs:
version:
name: Read version
runs-on: ubuntu-latest
outputs:
v: ${{ steps.read.outputs.v }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- id: read
run: |
v=$(awk '/substitutions:/ {f=1} f && /version:/ {print $2; exit}' \
Integrations/ESPHome/Core.yaml | tr -d '"')
echo "v=$v" >> "$GITHUB_OUTPUT"
echo "Beta version: $v"

build:
name: Build ${{ matrix.name }}
needs: version
strategy:
matrix:
include:
# Beta serves OTA updates only, so it builds the end-user image
# (MSR-2.yaml), not the first-flash Factory image.
- { yaml: Integrations/ESPHome/beta-channel/MSR-2.yaml, name: firmware-standard }
- { yaml: Integrations/ESPHome/beta-channel/MSR-2_BLE.yaml, name: firmware-ble-beta }
uses: esphome/workflows/.github/workflows/build.yml@025a1e6255610c498ed590403b7e510b69e474df # 2026.4.1
with:
files: ${{ matrix.yaml }}
esphome-version: stable
combined-name: ${{ matrix.name }}
release-version: ${{ needs.version.outputs.v }}

publish-beta:
name: Publish beta release assets
needs: [version, build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download firmware artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: fw
pattern: firmware*

- name: Ensure rolling 'beta-fw' pre-release exists
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release view beta-fw -R "${{ github.repository }}" >/dev/null 2>&1 \
|| gh release create beta-fw -R "${{ github.repository }}" \
--prerelease --title "Beta (rolling)" \
--notes "Latest MSR-2 beta firmware. Auto-updated on every push to the beta branch."

- name: Rewrite manifests to absolute URLs and upload assets
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BASE="https://github.com/${{ github.repository }}/releases/download/beta-fw"
declare -A DIRS=( [standard]=firmware-standard [ble]=firmware-ble-beta )
for v in standard ble; do
src="fw/${DIRS[$v]}"
man=$(find "$src" -name manifest.json | head -1)
if [ -z "$man" ]; then
echo "::error::manifest.json not found for ${DIRS[$v]}"
exit 1
fi
# Both variants share a device name, so their bin filenames match.
# Release assets are a flat namespace: prefix per variant.
find "$src" -name '*.bin' | while read -r bin; do
mv "$bin" "$(dirname "$bin")/$v-$(basename "$bin")"
done
echo "Rewriting $man"
# Make ota.path and parts[].path absolute release-asset URLs so the
# device never has to resolve a relative path against a redirect.
jq --arg base "$BASE" --arg pfx "$v-" '
.builds[0].ota.path = ($base + "/" + $pfx + (.builds[0].ota.path | sub(".*/"; "")))
| .builds[0].parts |= map(.path = ($base + "/" + $pfx + (.path | sub(".*/"; ""))))
' "$man" > "manifest-$v.json"
cat "manifest-$v.json"
gh release upload beta-fw "manifest-$v.json" -R "${{ github.repository }}" --clobber
find "$src" -name '*.bin' -print -exec \
gh release upload beta-fw {} -R "${{ github.repository }}" --clobber \;
done
echo "Beta assets published."
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ jobs:
pull-requests: write
with:
device-name: msr-2
# MSR-2.yaml is the end-user image served at firmware/ (OTA updates). The Factory image (improv +
# factory test) is only used for first flashes via the web installer.
yaml-files: |
Integrations/ESPHome/MSR-2.yaml
Integrations/ESPHome/MSR-2_Factory.yaml
firmware-names: "2_Factory:firmware"
Integrations/ESPHome/MSR-2_BLE.yaml
firmware-names: "2:firmware,2_Factory:firmware-factory,2_BLE:firmware-ble"
core-yaml-path: Integrations/ESPHome/Core.yaml
esphome-version: stable
# Bypass check if manually triggered with bypass option
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/label-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Label Check

# pull_request_target (not pull_request) so the job gets a write token on
# fork-submitted PRs too; plain pull_request runs from forks are read-only
# and cannot add labels. Safe because the called workflow only reads the PR
# body and never checks out or executes PR code. The "edited" type re-runs
# the check when the template checkboxes are changed.
on:
pull_request_target:
types: [opened, edited, reopened, synchronize]

permissions:
pull-requests: write
issues: write
contents: read

jobs:
label-check:
name: Label Check
uses: ApolloAutomation/Workflows/.github/workflows/label-check.yml@main
Loading