-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
195 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name-template: 'v$RESOLVED_VERSION 🌈' | ||
tag-template: 'v$RESOLVED_VERSION' | ||
change-template: '- #$NUMBER $TITLE @$AUTHOR' | ||
sort-direction: ascending | ||
categories: | ||
- title: '🚀 Features' | ||
labels: | ||
- 'feature' | ||
- 'enhancement' | ||
|
||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
|
||
- title: '🧰 Maintenance' | ||
label: 'chore' | ||
|
||
version-resolver: | ||
major: | ||
labels: | ||
- 'major' | ||
minor: | ||
labels: | ||
- 'minor' | ||
patch: | ||
labels: | ||
- 'patch' | ||
default: patch | ||
template: | | ||
[![Downloads for this release](https://img.shields.io/github/downloads/JohNan/home-assistant-flichub/v$RESOLVED_VERSION/total.svg)](https://github.com/JohNan/home-assistant-flichub/releases/v$RESOLVED_VERSION) | ||
## Changes | ||
$CHANGES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: "Cron actions 16:30 every 4 days" | ||
on: | ||
schedule: | ||
- cron: '30 16 */4 * *' | ||
|
||
jobs: | ||
validate-hassfest: | ||
name: With hassfest | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Update manifest.json" | ||
run: | | ||
python3 ${{ github.workspace }}/manage/update_manifest.py | ||
- name: Hassfest validation | ||
uses: home-assistant/actions/hassfest@master | ||
|
||
validate-hacs: | ||
name: With HACS action | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Update manifest.json" | ||
run: | | ||
python3 ${{ github.workspace }}/manage/update_manifest.py | ||
- name: HACS Validation | ||
uses: hacs/action@main | ||
with: | ||
category: integration | ||
comment: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
update_release_draft: | ||
name: Update release draft | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create Release | ||
uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
release_zip_file: | ||
name: Prepare release asset | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get version | ||
id: version | ||
uses: home-assistant/actions/helpers/version@master | ||
|
||
- name: "Set version number" | ||
run: | | ||
python3 ${{ github.workspace }}/manage/update_manifest.py --version ${{ steps.version.outputs.version }} | ||
- name: Create zip | ||
run: | | ||
cd custom_components/flichub | ||
zip flichub.zip -r ./ | ||
- name: Upload zip to release | ||
uses: svenstaro/upload-release-action@v1-release | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ./custom_components/flichub/flichub.zip | ||
asset_name: flichub.zip | ||
tag: ${{ github.ref }} | ||
overwrite: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: "Validate" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
validate-hassfest: | ||
name: With hassfest | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Update manifest.json" | ||
run: | | ||
python3 ${{ github.workspace }}/manage/update_manifest.py | ||
- name: Hassfest validation | ||
uses: home-assistant/actions/hassfest@master | ||
|
||
validate-hacs: | ||
name: With HACS action | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Update manifest.json" | ||
run: | | ||
python3 ${{ github.workspace }}/manage/update_manifest.py | ||
- name: HACS Validation | ||
uses: hacs/action@main | ||
with: | ||
ignore: brands | ||
category: integration | ||
comment: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
{ | ||
"name": "Flic Hub", | ||
"hacs": "1.6.0", | ||
"domains": ["binary_sensor", "sensor", "switch"], | ||
"iot_class": "Cloud Polling", | ||
"homeassistant": "0.118.0" | ||
"homeassistant": "2021.12.0", | ||
"hide_default_branch": true, | ||
"zip_release": true, | ||
"filename": "flichub.zip" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""Update the manifest file.""" | ||
import sys | ||
import json | ||
import os | ||
|
||
|
||
def update_manifest(): | ||
"""Update the manifest file.""" | ||
version = "0.0.0" | ||
for index, value in enumerate(sys.argv): | ||
if value in ["--version", "-V"]: | ||
version = sys.argv[index + 1] | ||
|
||
with open(f"{os.getcwd()}/custom_components/flichub/manifest.json") as manifestfile: | ||
manifest = json.load(manifestfile) | ||
|
||
manifest["version"] = version | ||
|
||
with open( | ||
f"{os.getcwd()}/custom_components/flichub/manifest.json", "w" | ||
) as manifestfile: | ||
manifestfile.write(json.dumps(manifest, indent=4, sort_keys=True)) | ||
|
||
|
||
update_manifest() |