Skip to content

Commit cbda95b

Browse files
committed
push github automation
1 parent dc33cca commit cbda95b

3 files changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: HACS Validation
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
schedule:
8+
- cron: "0 0 * * *"
9+
10+
jobs:
11+
validate:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: hacs/action@main
16+
with:
17+
category: integration

.github/workflows/pre-commit.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Pre-commit
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: "3.13"
16+
- uses: pre-commit/action@v3.0.1

.github/workflows/release.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Validate version matches release tag
13+
run: |
14+
version=$(python3 -c "import json; print(json.load(open('custom_components/cpu_capacity/manifest.json'))['version'])")
15+
tag="${GITHUB_REF#refs/tags/v}"
16+
if [ "$version" != "$tag" ]; then
17+
echo "manifest.json version ($version) does not match release tag ($tag)"
18+
exit 1
19+
fi

0 commit comments

Comments
 (0)