Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!--
From Core.yaml. Should match date YY.MM.DD.# ( Usually # is 1 )
-->
Version:

<!--
You are amazing! Thanks for contributing to our project!
Please, DO NOT DELETE ANY TEXT from this template! (unless instructed).
-->
## What does this implement/fix?



## Types of changes
<!--
What type of change does your PR introduce?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->

- [ ] Bugfix (fixed change that fixes an issue)
- [ ] New feature (thanks!)
- [ ] Breaking change (repair/feature that breaks existing functionality)
- [ ] Dependency Update - Does not publish
- [ ] Other - Does not publish
- [ ] Website of github readme file update - Does not publish
- [ ] Github workflows - Does not publish


## Checklist / Checklijst:
<!--
Put an x in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->

- [ ] The code change has been tested and works locally
- [ ] The code change has not yet been tested

If user-visible functionality or configuration variables are added/modified:
- [ ] Added/updated documentation for the web page

<!--
Thank you for contributing <3
-->
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "chore(ci): "
groups:
github-actions:
patterns:
- "*"
35 changes: 35 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name-template: 'Release v$NEXT_PATCH_VERSION'
tag-template: "$RESOLVED_VERSION"
change-template: "- #$NUMBER $TITLE @$AUTHOR"
sort-direction: ascending

categories:
- title: "🚨 Breaking changes"
labels:
- "breaking-change"
- title: "✨ New features"
labels:
- "new-feature"
- title: "🐛 Bug fixes"
labels:
- "bugfix"
- title: "⬆️ Dependency updates"
collapse-after: 5
labels:
- "dependency-update"

include-labels:
- "bugfix"
- "new-feature"
- "breaking-change"

no-changes-template: '- No changes'

template: |
## What's Changed

$CHANGES

**Full Changelog**: https://github.com/ApolloAutomation/MSR-1/compare/$PREVIOUS_TAG...$RESOLVED_VERSION.1

Be sure to 🌟 this repository for updates!
158 changes: 26 additions & 132 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,142 +1,36 @@
name: Build
env:
DEVICE_NAME: msr-1
RELEASE_URL: ${{ github.server_url }}/${{ github.repository }}/releases/latest
name: Build and Publish

on:
push:
branches:
- main
workflow_dispatch:
inputs:
bypass-yaml-check:
description: 'Bypass YAML change check (force build/publish)'
type: boolean
required: false
default: false
# release:
# types: [published]

jobs:
build:
name: Build And Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set uppercase DEVICE_NAME
run: |
echo "UPPERCASE_DEVICE_NAME=$(echo $DEVICE_NAME | tr '[:lower:]' '[:upper:]')" >> $GITHUB_ENV

- name: Build Firmware
uses: esphome/build-action@v3.0.0
id: esphome-build
with:
yaml_file: Integrations/ESPHome/${{ env.UPPERCASE_DEVICE_NAME }}.yaml
version: 'latest'
cache: true

- name: Read version from YAML file
id: read_version
run: |
version=$(awk '/substitutions:/ {found=1} found && /version:/ {print $2; exit}' Integrations/ESPHome/${{ env.UPPERCASE_DEVICE_NAME }}.yaml | tr -d '"')
echo "project_version=$version" >> $GITHUB_ENV

- name: Move generated files to output
run: |
mkdir -p output
mv ${{ steps.esphome-build.outputs.name }}/* output/
echo ${{ steps.esphome-build.outputs.version }} > output/version
# Extract MD5 checksum of firmware.ota.bin
MD5_CHECKSUM=$(jq -r '.ota.md5' output/manifest.json)
echo "MD5_CHECKSUM=$MD5_CHECKSUM" >> $GITHUB_ENV

# Create new manifest.json with jq
jq -n --arg name "${{ env.DEVICE_NAME }}" \
--arg version "${{ env.project_version }}" \
--arg md5 "$MD5_CHECKSUM" \
'{name: $name, version: $version, home_assistant_domain: "esphome", new_install_prompt_erase: false, builds: [{chipFamily: "ESP32-C3", parts: [{path: "apollo-${{ env.DEVICE_NAME }}-esp32c3.factory.bin", offset: 0}], ota: {path: "apollo-${{ env.DEVICE_NAME }}-esp32c3.ota.bin", md5: $md5}}]}' > output/manifest.json


- uses: actions/upload-artifact@v4.3.3
with:
path: output/
retention-days: 1

- name: Collect merge commits
id: collect_commits
run: |
MERGE_COMMITS=$(git log --merges --pretty=format:"%h %s" $(git describe --tags --abbrev=0 @^)..@)
echo "MERGE_COMMITS=$MERGE_COMMITS" >> $GITHUB_ENV

- name: Create Release
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
with:
tag_name: ${{ env.project_version }}
release_name: "Release ${{ env.project_version }}"
body: Release of version ${{ env.project_version }}

draft: false
prerelease: false

- name: Upload firmware.factory.bin to Release
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: output/apollo-${{ env.DEVICE_NAME }}-esp32c3.factory.bin
asset_name: apollo-${{ env.DEVICE_NAME }}-esp32c3.factory.bin
asset_content_type: application/octet-stream

- name: Upload firmware.ota.bin to Release
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: output/apollo-${{ env.DEVICE_NAME }}-esp32c3.ota.bin
asset_name: apollo-${{ env.DEVICE_NAME }}-esp32c3.ota.bin
asset_content_type: application/octet-stream
- name: Upload firmware.ota.bin to Release
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: output/manifest.json
asset_name: manifest.json
asset_content_type: application/octet-stream


prep:
name: Consolidate firmwares
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4.1.7
with:
path: output
- run: cp -R static/* output/
- uses: actions/upload-pages-artifact@v3.0.1
with:
path: output
retention-days: 1

deploy:
if: contains(fromJSON('["workflow_dispatch", "push", "schedule"]'), github.event_name) && github.ref == 'refs/heads/main'
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: prep
build-and-publish:
uses: ApolloAutomation/Workflows/.github/workflows/build.yml@main
permissions:
contents: write
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4.0.5
pull-requests: write
with:
device-name: msr-2
yaml-files: |
Integrations/ESPHome/MSR-1_Factory.yaml
firmware-names: "_Factory:firmware"
core-yaml-path: Integrations/ESPHome/Core.yaml
esphome-version: stable
# Bypass check if manually triggered with bypass option
check-yaml-changes: ${{ !(github.event_name == 'workflow_dispatch' && github.event.inputs.bypass-yaml-check == 'true') }}
publish-to-pages: true
has-installer: true
installer-path: static
20 changes: 15 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
name: CI

on:
pull_request:

permissions:
# Allow GITHUB_TOKEN to add labels to pull requests
pull-requests: write
issues: write
contents: read
id-token: write

jobs:
label-check:
name: Label Check
uses: ApolloAutomation/Workflows/.github/workflows/label-check.yml@main

ci:
name: Building ${{ matrix.file }}
name: Building ${{ matrix.file }} / ESPHome ${{ matrix.esphome-version }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -19,8 +29,8 @@ jobs:
- dev
steps:
- name: Checkout source code
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2
- name: Build ESPHome firmware to verify configuration
uses: esphome/build-action@v3.1.0
uses: esphome/build-action@v7
with:
yaml_file: ${{ matrix.file }}
yaml-file: ${{ matrix.file }}
2 changes: 1 addition & 1 deletion Integrations/ESPHome/Core.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
substitutions:
version: "25.2.27.1"
version: "25.7.18.1"
device_description: ${name} made by Apollo Automation - version ${version}.

esp32:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ YAML Files:
- MSR-1_Factory.yaml: This is the firmware flashed by us on new devices. It contains the components for ESP improve, allowing easy adoption in Home Assistant. When you load the device in ESPHome addon, it will grab the firmware from MSR-1.yaml which no longer has the improve.

Links: \
Discord (Support/feedback/discussion/future products): [https://discord.gg/8PpS4yUaUh](https://discord.gg/mMNgQPyF94) \
Discord (Support/feedback/discussion/future products): [https://dsc.gg/ApolloAutomation](https://dsc.gg/ApolloAutomation) \
Shop: [https://apolloautomation.com](https://apolloautomation.com) \
Wiki: [https://wiki.apolloautomation.com](https://wiki.apolloautomation.com/) \
3D Files: [https://www.printables.com/model/564297-apollo-automation-msr-1-mmwave-co2-multisensor-for](https://www.printables.com/model/564297-apollo-automation-msr-1-mmwave-co2-multisensor-for)
2 changes: 1 addition & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<h1>Apollo MSR-1 Installer</h1>

<p class="button-row" align="center">
<esp-web-install-button manifest="./artifact/manifest.json">
<esp-web-install-button manifest="./firmware/manifest.json">
</esp-web-install-button>
</p>

Expand Down