Skip to content

Commit

Permalink
Add GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrMachowski committed Jan 24, 2022
1 parent 5751eb2 commit 00a3801
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/hacs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Validate HACS
on:
push:
pull_request:
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Download repo
with:
fetch-depth: 0

- uses: actions/setup-python@v2
name: Setup Python
with:
python-version: '3.8.x'

- uses: actions/cache@v2
name: Cache
with:
path: |
~/.cache/pip
key: custom-component-ci

- name: HACS Action
uses: hacs/action@main
with:
CATEGORY: integration
12 changes: 12 additions & 0 deletions .github/workflows/hassfest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Validate with hassfest

on:
push:
pull_request:

jobs:
validate:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
- uses: home-assistant/actions/hassfest@master
27 changes: 27 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release

on:
release:
types: [published]

jobs:
release:
name: Prepare release
runs-on: ubuntu-latest
steps:
- name: Download repo
uses: actions/checkout@v1

- name: Zip mpk_lodz dir
run: |
cd /home/runner/work/Home-Assistant-custom-components-MPK-Lodz/Home-Assistant-custom-components-MPK-Lodz/custom_components/mpk_lodz
zip mpk_lodz.zip -r ./
- name: Upload zip to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /home/runner/work/Home-Assistant-custom-components-MPK-Lodz/Home-Assistant-custom-components-MPK-Lodz/custom_components/mpk_lodz/mpk_lodz.zip
asset_name: mpk_lodz.zip
tag: ${{ github.ref }}
overwrite: true
8 changes: 8 additions & 0 deletions hacs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "MPK Łódź",
"domains": ["sensor"],
"country": "PL",
"render_readme": true,
"zip_release": true,
"filename": "mpk_lodz.zip"
}

0 comments on commit 00a3801

Please sign in to comment.