Skip to content

Commit

Permalink
Merge pull request klaasnicolaas#517 from klaasnicolaas/release/v4.1.0
Browse files Browse the repository at this point in the history
Release v4.1.0
  • Loading branch information
klaasnicolaas authored Jul 3, 2024
2 parents e9ce758 + 7b83b5d commit 7f81bb3
Show file tree
Hide file tree
Showing 17 changed files with 378 additions and 211 deletions.
6 changes: 4 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
tag-template: "$RESOLVED_VERSION"
change-template: "- #$NUMBER $TITLE @$AUTHOR"
sort-direction: ascending

Expand Down Expand Up @@ -58,6 +58,8 @@ version-resolver:
template: |
## What's changed
_To receive a notification on new releases, click on **Watch** > **Custom** > **Releases** on the top._
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_VERSION
104 changes: 17 additions & 87 deletions .github/workflows/build-firmware.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
---
# Build the ESPHome firmwares for the Home Assistant Glow project.
name: Build & Deploy firmware
# Test building ESPHome firmwares for the Home Assistant Glow project.
name: Build firmware

on:
push:
branches:
- main
# release:
# types:
# - published
- develop
- release/**
workflow_dispatch:
workflow_call:
inputs:
release-url:
required: true
type: string
pull_request:
branches-ignore:
- renovate/docusaurus**
Expand Down Expand Up @@ -89,13 +92,20 @@ jobs:
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: 🔍 Determine ref - ESPHome packages
if: ${{ !contains(fromJSON('["release", "workflow_call"]'), github.event_name) }}
run: |
echo "ref: ${{ github.head_ref || github.ref_name }}"
sed -i "s|ref: .*|ref: \"${{ github.head_ref || github.ref_name }}\"|g" ${{ matrix.firmware }}/${{ matrix.device }}.yaml
- name: 🧪 Display changed YAML file
run: cat ${{ matrix.firmware }}/${{ matrix.device }}.yaml
- name: 🔨 Build firmware
uses: esphome/build-action@v3.1.0
id: esphome-build
with:
yaml_file: ${{ matrix.firmware }}/${{ matrix.device }}.yaml
version: ${{ matrix.version || 'latest' }}
release_url: ${{ github.event.release.html_url || env.RELEASE_URL }}
release_url: ${{ inputs.release-url || env.RELEASE_URL }}
cache: true
- name: 🚚 Move generated files to output
run: |
Expand All @@ -111,83 +121,3 @@ jobs:
name: build-${{ matrix.firmware}}-${{ matrix.device }}
path: output
retention-days: 1

combined-manifests:
name: Combine ${{ matrix.project }} manifests
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
include:
- project: home-assistant-glow
name: Home Assistant Glow
steps:
- name: ⤵️ Download specific artifacts
uses: actions/download-artifact@v4.1.7
with:
pattern: build-${{ matrix.project }}-*
merge-multiple: true
path: files
- name: 🔨 Generate device manifest.json
run: |
version=$(cat files/*/version | sort -V | tail -n 1)
jq -s --arg version "$version" '{"name": "${{ matrix.name }}", "version": $version, "home_assistant_domain": "esphome", "builds":.}' files/*/manifest.json > files/manifest.json
- name: 🧪 Display structure of job
run: ls -R
- name: ⬆️ Upload project artifact
uses: actions/upload-artifact@v4.3.3
with:
name: ${{ matrix.project }}
path: files
retention-days: 1

build-docs:
name: Build documentation
if: contains(fromJSON('["workflow_dispatch", "push", "schedule"]'), github.event_name) && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: combined-manifests
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: ⬇️ Download all artifacts
uses: actions/download-artifact@v4.1.7
with:
pattern: "!build-*"
path: output
- name: 🗂️ Move firmware folders to static
run: mv output/* docs/static
- name: 🧪 Display structure of job
run: ls -R

- name: 🏗️ Set up Node.js
uses: actions/setup-node@v4.0.2
with:
node-version: 20.x
- name: 🏗️ Install Docusaurus dependencies
run: npm install --frozen-lockfile --non-interactive
working-directory: docs
- name: 🚀 Build Docusaurus
run: npm run build
working-directory: docs
- name: ⬆️ Upload pages artifacts
uses: actions/upload-pages-artifact@v3.0.1
with:
path: docs/build

deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: build-docs
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: 🏗️ Setup Github Pages
uses: actions/configure-pages@v5.0.0
- name: 🚀 Deploy to Github Pages
uses: actions/deploy-pages@v4.0.5
id: deployment
108 changes: 108 additions & 0 deletions .github/workflows/deploy-firmware.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
# Build & Deploy the ESPHome firmwares for the Home Assistant Glow project.
name: Deploy firmware

on:
release:
types:
- published
workflow_dispatch:
inputs:
release-tag:
description: "Release tag"
default: "x.x.x"
required: true
type: string
release-url:
description: "Release URL"
default: "https://github.com"
required: true
type: string

jobs:
build-firmware:
if: ${{ github.event.ref == 'refs/heads/main' }}
uses: klaasnicolaas/home-assistant-glow/.github/workflows/build-firmware.yaml@main
name: Firmware
with:
release-url: ${{ github.event.release.html_url || inputs.release-url }}

combined-manifests:
name: Combine ${{ matrix.project }} manifests
runs-on: ubuntu-latest
needs: build-firmware
strategy:
fail-fast: false
matrix:
include:
- project: home-assistant-glow
name: Home Assistant Glow
steps:
- name: ⤵️ Download specific artifacts
uses: actions/download-artifact@v4.1.7
with:
pattern: build-${{ matrix.project }}-*
merge-multiple: true
path: files
- name: 🔨 Generate device manifest.json
run: |
version=${{ github.event.release.tag_name || inputs.release-tag }}
jq -s --arg version "$version" '{"name": "${{ matrix.name }}", "version": $version, "home_assistant_domain": "esphome", "builds":.}' files/*/manifest.json > files/manifest.json
- name: 🧪 Display structure of job
run: ls -R
- name: ⬆️ Upload project artifact
uses: actions/upload-artifact@v4.3.3
with:
name: ${{ matrix.project }}
path: files
retention-days: 1

build-docs:
name: Build documentation
if: contains(fromJSON('["workflow_dispatch", "release"]'), github.event_name) && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: combined-manifests
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: ⬇️ Download all artifacts
uses: actions/download-artifact@v4.1.7
with:
pattern: "!build-*"
path: output
- name: 🗂️ Move firmware folders to static
run: mv output/* docs/static
- name: 🧪 Display structure of job
run: ls -R

- name: 🏗️ Set up Node.js
uses: actions/setup-node@v4.0.2
with:
node-version: 20.x
- name: 🏗️ Install Docusaurus dependencies
run: npm install --frozen-lockfile --non-interactive
working-directory: docs
- name: 🚀 Build Docusaurus
run: npm run build
working-directory: docs
- name: ⬆️ Upload pages artifacts
uses: actions/upload-pages-artifact@v3.0.1
with:
path: docs/build

deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: build-docs
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: 🏗️ Setup Github Pages
uses: actions/configure-pages@v5.0.0
- name: 🚀 Deploy to Github Pages
uses: actions/deploy-pages@v4.0.5
id: deployment
2 changes: 1 addition & 1 deletion .github/workflows/labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
# The default branch
branches:
- main
- develop
paths:
- .github/labels.yml
workflow_dispatch:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pr-labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ name: PR Labels

# yamllint disable-line rule:truthy
on:
pull_request_target:
pull_request:
# Don't run on target branch
branches-ignore:
- main
types: [opened, labeled, unlabeled, synchronize]

jobs:
pr_labels:
validate:
name: Verify
runs-on: ubuntu-latest
steps:
- name: 🏷 Verify PR has a valid label
uses: jesusvasquez333/verify-pr-label-action@v1.4.0
uses: klaasnicolaas/action-pr-labels@v2.0.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
pull-request-number: "${{ github.event.pull_request.number }}"
valid-labels: >-
breaking-change, bugfix, documentation, enhancement,
breaking-change, bugfix, documentation, enhancement, sync,
refactor, performance, new-feature, maintenance, ci, dependencies
disable-reviews: true
1 change: 1 addition & 0 deletions .github/workflows/release-drafter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- main
- develop

jobs:
update_release_draft:
Expand Down
24 changes: 14 additions & 10 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,26 @@ To make sure your meter will work with the Home Assistant Glow, you have to look
<img width="60%" src="docs/static/img/pulse_rate.png">
</p>

## Get Started
## Getting Started

> [!IMPORTANT]
> Please note, the default branch shows development and may be ahead of the released version. For copying YAML code, use the [release branch](https://github.com/klaasnicolaas/home-assistant-glow/releases/latest). It's best to use the [website](https://glow-energy.io/docs/getting-started#step-2-install-firmware) to install the latest firmware on your ESP.
On the [documentation website](https://glow-energy.io/docs/introduction) you will find a complete walkthrough with which hardware you need, how to install the correct firmware on your ESP (using esp web tools) and how to add it to Home Assistant.

## Hardware

First, fill your 🛒 or see if you already have the components below.

- One of the micro controllers
- ESP32 (recommended) - [Banggood][esp32-bg-shop] or [AliExpress][esp32-ali-shop]
- ESP8266 - [Banggood][esp8266-bg-shop] or [AliExpress][esp8266-ali-shop]
- Wemos D1 mini - [Banggood][wemos-d1-bg-shop] or [AliExpress][wemos-d1-ali-shop]
- [Dupont Jumpers][dupont-jumpers-shop]
- 3D printed case (see the [case](https://glow-energy.io/docs/reference/cases) folder)
- LM393 Photodiode: [Banggood][photodiode-bg-shop] or [AliExpress][photodiode-ali-shop] (make sure that you do not accidentally order or receive an LDR)
- LED RGB 5mm 4 pin - kathode: [Banggood][rgbled-bg-shop] or [AliExpress][rgbled-ali-shop]
Choose one of the listed microcontrollers, but keep in mind that the ESP32 is recommended.

- ESP32 (recommended) - [AliExpress](https://s.click.aliexpress.com/e/_DdAe4Fl) or [Banggood][esp32-bg-shop] or [AliExpress][esp32-ali-shop]
- ESP8266 - [AliExpress](https://s.click.aliexpress.com/e/_DCd13n1) or [Banggood][esp8266-bg-shop] or [AliExpress][esp8266-ali-shop]
- Wemos D1 mini - [AliExpress](https://s.click.aliexpress.com/e/_DFkIzM7) or [Banggood][wemos-d1-bg-shop] or [AliExpress][wemos-d1-ali-shop]
- Dupont Jumpers (female to male) - [AliExpress](https://s.click.aliexpress.com/e/_DmbrJsj) or [Banggood][dupont-jumpers-shop]
- 3D-printed case (see the [case](https://glow-energy.io/docs/reference/cases) folder)
- LM393 Photodiode: [AliExpress](https://s.click.aliexpress.com/e/_DDkX3zN) or [Banggood][photodiode-bg-shop] or [AliExpress][photodiode-ali-shop] (please note that you will not receive an LDR)
- LED RGB 5mm 4 pin - kathode: [AliExpress](https://s.click.aliexpress.com/e/_Dn1D0wT) or [Banggood][rgbled-bg-shop] or [AliExpress][rgbled-ali-shop]

## Contributing

Expand All @@ -63,7 +67,7 @@ Thank you for being involved! :heart_eyes:

## Disclamer

We use AliExpress / Banggood affiliate links for the components and the tools. Some Ad-blockers might block these links an thus they seem to appear broken. You will have to temporarily disable ad-blocker to open these links.
Affiliate links are used on this repository to support the Home Assistant Glow 🌟 project. Some Ad-blockers might block these links and thus they seem to appear broken. You will have to temporarily disable ad-blocker to open these links.

## License

Expand Down
15 changes: 15 additions & 0 deletions components/updates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# OTA configuration #
ota:
- platform: esphome
id: ota_esphome
- platform: http_request
id: ota_http_request

update:
- platform: http_request
name: Firmware Update
source: https://glow-energy.io/home-assistant-glow/manifest.json

http_request:
timeout: 10s
verify_ssl: false
Loading

0 comments on commit 7f81bb3

Please sign in to comment.