Files
arduino-home-assistant/.github/workflows/release.yml
T
2026-09-02 07:14:20 +10:00

56 lines
1.8 KiB
YAML

name: Publish release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
ha-contract:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
home_assistant: ["2024.11.3", stable, dev]
env:
HA_VERSION: ${{ matrix.home_assistant }}
COMPOSE_FILE: tests/ha-contract/compose.yaml
steps:
- uses: actions/checkout@v4
- name: Start broker and Home Assistant
run: docker compose up -d mqtt homeassistant
- name: Check single-to-device migration
run: docker compose run --rm tests
- name: Restart Home Assistant from retained data
run: docker compose restart homeassistant
- name: Check retained discovery after restart
run: docker compose run --rm -e CONTRACT_MODE=retained-restart tests
- name: Collect Home Assistant logs on failure
if: failure()
run: docker compose logs --no-color homeassistant mqtt
- name: Remove contract volumes
if: always()
run: docker compose down -v
publish:
needs: ha-contract
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: python -m pip install --upgrade platformio==6.1.19
- run: ./scripts/test.sh compile --platform esp8266
- run: pio test -e native --filter test_native_core
- run: ./scripts/test.sh compile --platform esp32
- run: ./scripts/check-docs.sh
- run: ./scripts/prepare-release.sh "$GITHUB_REF_NAME"
- run: ./scripts/release-notes.sh "$GITHUB_REF_NAME" > "$RUNNER_TEMP/release-notes.md"
- run: gh release create "$GITHUB_REF_NAME" --title "ArduinoHA $GITHUB_REF_NAME" --notes-file "$RUNNER_TEMP/release-notes.md"
env:
GH_TOKEN: ${{ github.token }}