Skip to content

Commit 84841b1

Browse files
committed
feat: Update CI/CD workflows, release config, and documentation
- Fix CI and Release workflows with checkout, setup-node, and pnpm v4 - Use Node.js 22 for semantic-release compatibility - Remove replace plugin from release config (minified template literals aren't matchable) - Add HACS installation instructions to README - Expand HACS validation triggers (pull_request, schedule, workflow_dispatch) - Remove stale debug version logger from source
1 parent 8ca1a37 commit 84841b1

7 files changed

Lines changed: 83 additions & 422 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,21 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88

9-
- name: Cache pnpm modules
10-
id: cache-modules
11-
uses: actions/cache@v2
9+
- name: Checkout
10+
uses: actions/checkout@v4
11+
12+
- name: Setup Node
13+
uses: actions/setup-node@v4
1214
with:
13-
path: |
14-
~/.pnpm-store
15-
**/node_modules
16-
key: ${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'rollup.config.js') }}
17-
restore-keys: |
18-
${{ runner.os }}-
15+
node-version: 22
1916

2017
- name: Setup pnpm
21-
uses: pnpm/action-setup@v2.2.1
18+
uses: pnpm/action-setup@v4
2219
with:
2320
version: latest
2421
run_install: false
2522

2623
- name: Install Packages
27-
if: steps.cache-modules.outputs.cache-hit != 'true'
2824
run: pnpm install
2925

3026
- name: Build

.github/workflows/release.yaml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,23 @@ jobs:
1313

1414
steps:
1515

16-
- name: Cache pnpm modules
17-
id: cache-modules
18-
uses: actions/cache@v2
16+
- name: Checkout
17+
uses: actions/checkout@v4
1918
with:
20-
path: |
21-
~/.pnpm-store
22-
**/node_modules
23-
key: ${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'rollup.config.js') }}
24-
restore-keys: |
25-
${{ runner.os }}-
19+
fetch-depth: 0
20+
21+
- name: Setup Node
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 22
2625

2726
- name: Setup pnpm
28-
uses: pnpm/action-setup@v2.2.1
27+
uses: pnpm/action-setup@v4
2928
with:
3029
version: latest
3130
run_install: false
3231

3332
- name: Install Packages
34-
if: steps.cache-modules.outputs.cache-hit != 'true'
3533
run: pnpm install
3634

3735
- name: Build

.github/workflows/validate.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ name: HACS Validation
22

33
on:
44
push:
5-
branches:
6-
- main
5+
pull_request:
6+
schedule:
7+
- cron: "0 0 * * *"
8+
workflow_dispatch:
9+
710
jobs:
811
hacs:
912
runs-on: "ubuntu-latest"
1013
steps:
1114
- name: Checkout
12-
uses: "actions/checkout@v3"
15+
uses: "actions/checkout@v4"
1316
- name: Validate HACS
1417
uses: "hacs/action@main"
1518
with:

.releaserc.js

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,7 @@ module.exports = {
55
"@semantic-release/commit-analyzer",
66
"@semantic-release/release-notes-generator",
77
"@semantic-release/changelog",
8-
[
9-
"@google/semantic-release-replace-plugin",
10-
{
11-
replacements: [
12-
{
13-
files: ["dist/power-flow-live.js"],
14-
from: /Power Flow Live v(\d+\.\d+\.\d+)/,
15-
to: "Power Flow Live v${nextRelease.version}",
16-
results: [
17-
{
18-
file: "dist/power-flow-live.js",
19-
hasChanged: true,
20-
numMatches: 2,
21-
numReplacements: 2,
22-
},
23-
],
24-
countMatches: true,
25-
},
26-
],
27-
},
28-
],
29-
["@semantic-release/npm", { npmPublish: false }],
8+
["@semantic-release/npm", { npmPublish: false }],
309
[
3110
"@semantic-release/git",
3211
{

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ A custom [Home Assistant](https://home-assistant.io/) Lovelace card that visuali
44

55
<img width="454" alt="Screenshot 2023-02-17 at 1 46 52 AM" src="https://user-images.githubusercontent.com/14035884/219596902-40d68252-fa60-49ef-a354-f14d8a89b1a3.png">
66

7+
## Installation
8+
9+
### HACS (recommended)
10+
11+
1. Open HACS in your Home Assistant instance
12+
2. Search for "Power Flow Live"
13+
3. Click **Install**
14+
4. Restart Home Assistant
15+
716
### Manual install
817

918
1. Download and copy `power-flow-live.js` from the [latest release](https://github.com/mathewgreen/power-flow-live/releases/latest) into your `config/www` directory.

dist/power-flow-live.js

Lines changed: 51 additions & 371 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/power-flow-live.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ import {
1111
import { logError } from "./logging.js";
1212
import { CalculatedElementDef } from "./type.js";
1313

14-
// DEBUG: Version Logger to verify file load
15-
const VERSION = "2.1-FIXED";
16-
console.info(`%c POWER-FLOW-LIVE ${VERSION} IS LOADED `, 'background: #4caf50; color: #fff; font-weight: bold;');
17-
1814
@customElement("power-flow-live")
1915
export class PowerFlowLive extends LitElement {
2016
@property({ attribute: false }) public hass!: HomeAssistant;

0 commit comments

Comments
 (0)