Skip to content

Stable: minor release 2024.9.2 #988

Stable: minor release 2024.9.2

Stable: minor release 2024.9.2 #988

name: Check Home Assistant Release Compatibility
# Only run when called from webhook https://github.com/marketplace/actions/repository-dispatch
on:
repository_dispatch:
push:
branches:
- master
paths-ignore:
- '**/README.md'
- 'extras/**'
- '**/check-ha-release-compatibility.yml'
jobs:
check-ha-config:
name: Check Configuration
runs-on: ubuntu-latest
#runs-on: self-hosted
steps:
- name: Log Trigger Type
run: 'echo "Trigger: ${{ github.event_name }}"'
- name: Log Repo Dispatch Data
if: github.event_name == 'repository_dispatch'
run: |
echo "Branch: ${{ github.event.client_payload.branch }}"
echo "Release Type: ${{ github.event.client_payload.release_type }}"
echo "Release Version: ${{ github.event.client_payload.version }}" && echo "DOCKER_TAG=${{ github.event.client_payload.version }}" >> $GITHUB_ENV
- name: Set Docker Tag
if: github.event_name == 'push'
run: 'echo "DOCKER_TAG=latest" >> $GITHUB_ENV'
- name: Log Docker Tag
run: 'echo "Image: ghcr.io/home-assistant/home-assistant:${{ env.DOCKER_TAG }}"'
- uses: actions/checkout@v2
- name: Check Home Assistant Config
run: |
docker pull -q "homeassistant/home-assistant:${{ env.DOCKER_TAG }}"
mv github_action_secrets.yaml secrets.yaml
mkdir -p media/audio media/video media/images
sed -i -e 's/- camera/#- camera/' -e 's/^camera/#camera/' configuration.yaml
# See media_dirs in configuration.yaml
mkdir audio
docker run --rm --entrypoint "" \
homeassistant/home-assistant:${{ env.DOCKER_TAG }} \
python -m homeassistant --version
docker run --rm -v "$(pwd):/config" --entrypoint "" \
homeassistant/home-assistant:${{ env.DOCKER_TAG }} \
python -m homeassistant --config "/config" --script check_config
# Call Home Assistant Webook to notify of completion and allow HASS to decide what to do
hass-callback:
name: Home Assistant Callback
runs-on: ubuntu-latest
if: github.event_name == 'repository_dispatch'
needs: check-ha-config
# A stupid workaround to be able to set curl header.
env:
HEADER: "Content-Type: application/json"
steps:
- run: curl -sX POST -H "$HEADER" -d '{ "action_complete":true}' ${{ secrets.HASS_WEBHOOK }} && echo "Home Assistant callback complete"
# Tag a release for current state with major stable version
publish-release:
permissions: write-all
runs-on: ubuntu-latest
needs: check-ha-config
if: (github.event_name == 'repository_dispatch') && (github.event.client_payload.release_type == 'major') && (github.event.client_payload.branch == 'stable')
steps:
- uses: actions/checkout@v1
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.event.client_payload.version }}
release_name: Release for v${{ github.event.client_payload.version }}
body: Release for v${{ github.event.client_payload.version }}
draft: false
prerelease: false