Skip to content

Commit 5b72ec5

Browse files
authored
Merge pull request #9 from PiotrMachowski/GitHub-Actions
Add GitHub Actions
2 parents bc2ee21 + a596488 commit 5b72ec5

4 files changed

Lines changed: 70 additions & 1 deletion

File tree

.github/workflows/hacs.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Validate HACS
3+
on:
4+
push:
5+
pull_request:
6+
jobs:
7+
hacs:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
name: Checkout code
12+
13+
- name: HACS Action
14+
uses: hacs/action@main
15+
with:
16+
category: integration
17+
ignore: brands

.github/workflows/hassfest.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Validate with hassfest
3+
4+
on:
5+
push:
6+
pull_request:
7+
8+
jobs:
9+
hassfest:
10+
runs-on: "ubuntu-latest"
11+
steps:
12+
- uses: actions/checkout@v4
13+
name: Checkout code
14+
15+
- uses: home-assistant/actions/hassfest@master
16+
name: Run hassfest validation

.github/workflows/release.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
COMPONENT_NAME: roborock_custom_map
9+
10+
jobs:
11+
release:
12+
name: Prepare release
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
id-token: write
17+
steps:
18+
- name: Download repo
19+
uses: actions/checkout@v4
20+
21+
- name: Adjust version number
22+
shell: bash
23+
run: |
24+
version="${{ github.event.release.tag_name }}"
25+
yq e -P -o=json \
26+
-i ".version = \"${version}\"" \
27+
"${{ github.workspace }}/custom_components/${{ env.COMPONENT_NAME }}/manifest.json"
28+
29+
- name: Zip ${{ env.COMPONENT_NAME }} dir
30+
run: |
31+
cd "${{ github.workspace }}/custom_components/${{ env.COMPONENT_NAME }}"
32+
zip ${{ env.COMPONENT_NAME }}.zip -r ./
33+
34+
- name: Upload zip to release
35+
uses: softprops/action-gh-release@v2.1.0
36+
with:
37+
files: ${{ github.workspace }}/custom_components/${{ env.COMPONENT_NAME }}/${{ env.COMPONENT_NAME }}.zip

custom_components/roborock_custom_map/manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@
88
"iot_class": "local_polling",
99
"issue_tracker": "https://github.com/Lash-L/RoborockCustomMap/issues",
1010
"requirements": [],
11-
1211
"version": "0.1.1"
1312
}

0 commit comments

Comments
 (0)