diff --git a/.github/workflows/hacs.yaml b/.github/workflows/hacs.yaml new file mode 100644 index 0000000..a59c9a8 --- /dev/null +++ b/.github/workflows/hacs.yaml @@ -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 \ No newline at end of file diff --git a/.github/workflows/hassfest.yaml b/.github/workflows/hassfest.yaml new file mode 100644 index 0000000..d1c56cb --- /dev/null +++ b/.github/workflows/hassfest.yaml @@ -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 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..7b15adc --- /dev/null +++ b/.github/workflows/release.yaml @@ -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 \ No newline at end of file diff --git a/hacs.json b/hacs.json new file mode 100644 index 0000000..e8705c2 --- /dev/null +++ b/hacs.json @@ -0,0 +1,8 @@ +{ + "name": "MPK Łódź", + "domains": ["sensor"], + "country": "PL", + "render_readme": true, + "zip_release": true, + "filename": "mpk_lodz.zip" +} \ No newline at end of file