1
0

Compare commits

...

66 Commits

9 changed files with 99 additions and 28 deletions

View File

@@ -10,6 +10,7 @@ on:
jobs: jobs:
create-release: create-release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
continue-on-error: true
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
@@ -23,13 +24,14 @@ jobs:
git config user.name esphomebot git config user.name esphomebot
git config user.email esphome@nabucasa.com git config user.email esphome@nabucasa.com
git add . git add .
git commit -m "Bump version to v${{ github.event.inputs.version }}" git commit -m "Bump version to ${{ github.event.inputs.version }}"
git push git push
COMMIT=$(git rev-parse HEAD) COMMIT=$(git rev-parse HEAD)
echo "::set-output name=commit_sha::${COMMIT}" echo "::set-output name=commit_sha::${COMMIT}"
- if: ${{ contains(github.event.inputs.version, 'b') }} - if: ${{ contains(github.event.inputs.version, 'b') }}
name: Create Beta Release name: Create Beta Release
uses: actions/create-release@v1 uses: actions/create-release@v1
continue-on-error: true
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
@@ -41,6 +43,7 @@ jobs:
- if: ${{ !contains(github.event.inputs.version, 'b') }} - if: ${{ !contains(github.event.inputs.version, 'b') }}
name: Create Stable Release name: Create Stable Release
uses: actions/create-release@v1 uses: actions/create-release@v1
continue-on-error: true
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
@@ -54,20 +57,30 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [create-release] needs: [create-release]
steps: steps:
- name: Publish beta release to community-addons repository - name: Publish beta release to community-addons repository
run: | uses: peter-evans/repository-dispatch@v1.1.3
docker run --rm hassioaddons/repository-updater:latest \ with:
--repository hassio-addons/repository-beta \ token: ${{ secrets.COMMUNITY_ADDONS_TOKEN }}
--addon esphome \ repository: hassio-addons/repository-beta
--token "${TOKEN}" event-type: update
env: client-payload: >
TOKEN: ${{ secrets.COMMUNITY_ADDONS_TOKEN }} {
- if: ${{ !contains(github.event.inputs.version, 'b') }} "addon": "esphome",
name: Publish stable release to community-addons repository "name": "ESPHome",
run: | "repository": "esphome/home-assistant-addon",
docker run --rm hassioaddons/repository-updater:latest \ "version": "${{ github.event.inputs.version }}"
--repository hassio-addons/repository \ }
--addon esphome \ - if: ${{ !contains(github.event.inputs.version, 'b') }}
--token "${TOKEN}" name: Publish stable release to community-addons repository
env: uses: peter-evans/repository-dispatch@v1.1.3
TOKEN: ${{ secrets.COMMUNITY_ADDONS_TOKEN }} with:
token: ${{ secrets.COMMUNITY_ADDONS_TOKEN }}
repository: hassio-addons/repository
event-type: update
client-payload: >
{
"addon": "esphome",
"name": "ESPHome",
"repository": "esphome/home-assistant-addon",
"version": "${{ github.event.inputs.version }}"
}

46
.github/workflows/deploy-community.yml vendored Normal file
View File

@@ -0,0 +1,46 @@
name: Update Community Repo
on:
workflow_dispatch:
inputs:
version:
description: The version to release
required: true
beta:
description: Whether to release a beta version
type: boolean
required: false
default: false
jobs:
deploy-community-addons:
runs-on: ubuntu-latest
steps:
- if: ${{ contains(github.event.inputs.version, 'b') || github.event.inputs.beta == 'true' }}
name: Publish beta release to community-addons repository
uses: peter-evans/repository-dispatch@v1.1.3
with:
token: ${{ secrets.COMMUNITY_ADDONS_TOKEN }}
repository: hassio-addons/repository-beta
event-type: update
client-payload: >
{
"addon": "esphome",
"name": "ESPHome",
"repository": "esphome/home-assistant-addon",
"version": "${{ github.event.inputs.version }}"
}
- if: ${{ !contains(github.event.inputs.version, 'b') }}
name: Publish stable release to community-addons repository
uses: peter-evans/repository-dispatch@v1.1.3
with:
token: ${{ secrets.COMMUNITY_ADDONS_TOKEN }}
repository: hassio-addons/repository
event-type: update
client-payload: >
{
"addon": "esphome",
"name": "ESPHome",
"repository": "esphome/home-assistant-addon",
"version": "${{ github.event.inputs.version }}"
}

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
__pycache__/ __pycache__/
*.py[cod] *.py[cod]
*$py.class *$py.class
venv/

View File

@@ -1,4 +1,5 @@
{ {
"advanced": true,
"arch": [ "arch": [
"amd64", "amd64",
"armv7", "armv7",
@@ -39,5 +40,5 @@
"stage": "experimental", "stage": "experimental",
"uart": true, "uart": true,
"url": "https://beta.esphome.io/", "url": "https://beta.esphome.io/",
"version": "2021.9.3" "version": "2022.2.3"
} }

View File

@@ -1,4 +1,5 @@
{ {
"advanced": true,
"arch": [ "arch": [
"amd64", "amd64",
"armv7", "armv7",

View File

@@ -18,12 +18,18 @@ if bashio::config.has_value 'esphome_fork'; then
username="esphome" username="esphome"
ref=$esphome_fork ref=$esphome_fork
fi fi
full_url="https://github.com/${username}/esphome/archive/${ref}.zip" full_url="https://github.com/${username}/esphome/archive/${ref}.tar.gz"
bashio::log.info "Checking forked ESPHome" bashio::log.info "Checking forked ESPHome"
dev_version=$(python3 -c "from esphome.const import __version__; print(__version__)") dev_version=$(python3 -c "from esphome.const import __version__; print(__version__)")
bashio::log.info "Installing esphome from fork '${esphome_fork}' (${full_url})..." bashio::log.info "Downloading ESPHome from fork '${esphome_fork}' (${full_url})..."
pip3 install -U --no-cache-dir "${full_url}" -qq \ curl -L -o /tmp/esphome.tar.gz "${full_url}" -qq \
|| bashio::exit.nok "Failed installing esphome pinned version." || bashio::exit.nok "Failed downloading ESPHome fork."
bashio::log.info "Installing ESPHome from fork '${esphome_fork}' (${full_url})..."
mkdir /esphome-fork
tar -zxf /tmp/esphome.tar.gz -C /esphome-fork --strip-components=1 \
|| bashio::exit.nok "Failed installing ESPHome from fork."
pip install -U -e /esphome-fork || bashio::exit.nok "Failed installing ESPHome from fork."
rm -f /tmp/esphome.tar.gz
fork_version=$(python3 -c "from esphome.const import __version__; print(__version__)") fork_version=$(python3 -c "from esphome.const import __version__; print(__version__)")
if [[ "$fork_version" != "$dev_version" ]]; then if [[ "$fork_version" != "$dev_version" ]]; then
@@ -36,4 +42,5 @@ if bashio::config.has_value 'esphome_fork'; then
bashio::log.error "############################" bashio::log.error "############################"
bashio::exit.nok bashio::exit.nok
fi fi
bashio::log.info "Installed ESPHome from fork '${esphome_fork}' (${full_url})..."
fi fi

View File

@@ -38,5 +38,5 @@
"slug": "esphome", "slug": "esphome",
"uart": true, "uart": true,
"url": "https://esphome.io/", "url": "https://esphome.io/",
"version": "2021.9.3" "version": "2022.2.3"
} }

View File

@@ -1,5 +1,5 @@
{ {
"name": "ESPHome Home Assistant Add-Ons", "name": "ESPHome",
"url": "https://github.com/esphome/hassio", "url": "https://esphome.io",
"maintainer": "ESPHome <esphome@nabucasa.com>" "maintainer": "ESPHome <esphome@nabucasa.com>"
} }

View File

@@ -46,6 +46,7 @@ esphome-dev:
description: "Development version of ESPHome add-on" description: "Development version of ESPHome add-on"
url: https://next.esphome.io/ url: https://next.esphome.io/
stage: experimental stage: experimental
advanced: true
schema: schema:
ssl: bool? ssl: bool?
certfile: str? certfile: str?
@@ -61,18 +62,19 @@ esphome-beta:
<<: *base <<: *base
directory: esphome-beta directory: esphome-beta
name: ESPHome (beta) name: ESPHome (beta)
version: '2021.9.3' # BETA version: '2022.2.3' # BETA
slug: esphome-beta slug: esphome-beta
description: "Beta version of ESPHome add-on" description: "Beta version of ESPHome add-on"
url: https://beta.esphome.io/ url: https://beta.esphome.io/
image: ghcr.io/esphome/esphome-hassio-{arch} image: ghcr.io/esphome/esphome-hassio-{arch}
stage: experimental stage: experimental
advanced: true
esphome-stable: esphome-stable:
<<: *base <<: *base
directory: esphome directory: esphome
name: ESPHome name: ESPHome
version: '2021.9.3' # STABLE version: '2022.2.3' # STABLE
slug: esphome slug: esphome
description: "ESPHome add-on for intelligently managing all your ESP8266/ESP32 devices" description: "ESPHome add-on for intelligently managing all your ESP8266/ESP32 devices"
image: ghcr.io/esphome/esphome-hassio-{arch} image: ghcr.io/esphome/esphome-hassio-{arch}