Skip to content

Commit

Permalink
Optimize GitFlow Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed Mar 22, 2021
1 parent b4e2695 commit 9ed0111
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/hassfest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"
- cron: "0 0 * * mon"

jobs:
validate:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/py-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
---
name: "Python testing"

on: [push, pull_request]
on:
push:
branches:
- master
- main
- dev
pull_request:

jobs:
lint:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: "Release"

on:
push:
branches:
- master
tags:
- "[v1-9]+.[1-9]+*"

jobs:
release_zip_file:
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ Platform | Description

### Manual installation

1. Configure integration via Home Assistant GUI or via your `configuration.yaml` file using the configuration instructions below.
1. Restart Home Assistant

1. Using the tool of choice open the directory (folder) for your HA configuration (where you find `configuration.yaml`).
1. If you do not have a `custom_components` directory (folder) there, you need to create it.
1. In the `custom_components` directory (folder) create a new folder called `integration_blueprint`.
Expand Down
4 changes: 2 additions & 2 deletions bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ cd "${ROOT}"
source ./bin/_common

if output=$(git branch --show-current) \
&& [[ "$output" != "master" && "$output" != "main" ]]; then
log.fatal "Please, change HEAD to 'master' or 'main' branch."
&& [[ "$output" != "master" && "$output" != "main" && "$output" != "dev" ]]; then
log.fatal "Please, change HEAD to 'master', 'main' or 'dev' branch."
log.info "At now HEAD at '${output}' branch."
exit 1
fi
Expand Down
20 changes: 20 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,26 @@ log.info "Installing development dependencies..."
${pip} install colorlog pre-commit $(grep mypy requirements-dev.txt)

pre-commit install

if [[ -f secrets.yaml ]]; then
GITHUB_TOKEN=$(grep github_token secrets.yaml | cut -d' ' -f2)
# Backup original requirements and insert tokens
FILES=$(ls requirements*)
for FILE in ${FILES}
do
cp ${FILE}{,.bak}
sed -i "s/{GITHUB_TOKEN}/${GITHUB_TOKEN}/g" ${FILE}
done
fi

${pip} install -r requirements-dev.txt

if [[ -f secrets.yaml ]]; then
# Restore original requirements
for FILE in ${FILES}
do
mv -f ${FILE}{.bak,}
done
fi

echo '"""Custom components module."""' >custom_components/__init__.py
3 changes: 2 additions & 1 deletion custom_components/integration_blueprint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.typing import ConfigType
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed

from .api import IntegrationBlueprintApiClient
Expand All @@ -22,7 +23,7 @@
_LOGGER: logging.Logger = logging.getLogger(__package__)


async def async_setup(hass: HomeAssistant, config):
async def async_setup(hass: HomeAssistant, config: ConfigType):
"""Set up this integration using YAML."""
return True

Expand Down
File renamed without changes.

0 comments on commit 9ed0111

Please sign in to comment.