Skip to content

Commit b1c80f5

Browse files
Merge pull request #1 from ApolloAutomation/development
Development
2 parents 73c9efc + 84c50b2 commit b1c80f5

File tree

14 files changed

+1008
-287
lines changed

14 files changed

+1008
-287
lines changed

.DS_Store

-6 KB
Binary file not shown.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!--
2+
From Core.yaml. Should match date YY.MM.DD.# ( Usually # is 1 )
3+
-->
4+
Version:
5+
6+
<!--
7+
You are amazing! Thanks for contributing to our project!
8+
Please, DO NOT DELETE ANY TEXT from this template! (unless instructed).
9+
-->
10+
## What does this implement/fix?
11+
12+
13+
14+
## Types of changes
15+
<!--
16+
What type of change does your PR introduce?
17+
NOTE: Please, check only 1! box!
18+
If your PR requires multiple boxes to be checked, you'll most likely need to
19+
split it into multiple PRs. This makes things easier and faster to code review.
20+
-->
21+
22+
- [ ] Bugfix (fixed change that fixes an issue)
23+
- [ ] New feature (thanks!)
24+
- [ ] Breaking change (repair/feature that breaks existing functionality)
25+
- [ ] Dependency Update - Does not publish
26+
- [ ] Other - Does not publish
27+
- [ ] Website of github readme file update - Does not publish
28+
- [ ] Github workflows - Does not publish
29+
30+
31+
## Checklist / Checklijst:
32+
<!--
33+
Put an x in the boxes that apply. You can also fill these out after
34+
creating the PR. If you're unsure about any of them, don't hesitate to ask.
35+
We're here to help! This is simply a reminder of what we are going to look
36+
for before merging your code.
37+
-->
38+
39+
- [ ] The code change has been tested and works locally
40+
- [ ] The code change has not yet been tested
41+
42+
If user-visible functionality or configuration variables are added/modified:
43+
- [ ] Added/updated documentation for the web page
44+
45+
<!--
46+
Thank you for contributing <3
47+
-->
48+
49+

.github/release-drafter.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name-template: 'Release v$NEXT_PATCH_VERSION'
2+
tag-template: "$RESOLVED_VERSION"
3+
change-template: "- #$NUMBER $TITLE @$AUTHOR"
4+
sort-direction: ascending
5+
6+
categories:
7+
- title: "🚨 Breaking changes"
8+
labels:
9+
- "breaking-change"
10+
- title: "✨ New features"
11+
labels:
12+
- "new-feature"
13+
- title: "🐛 Bug fixes"
14+
labels:
15+
- "bugfix"
16+
# - title: "🚀 Enhancements"
17+
# labels:
18+
# - "enhancement"
19+
# - "refactor"
20+
# - "performance"
21+
# - title: "🧰 Maintenance"
22+
# labels:
23+
# - "maintenance"
24+
# - "ci"
25+
# - title: "📚 Documentation"
26+
# labels:
27+
# - "documentation"
28+
- title: "⬆️ Dependency updates"
29+
collapse-after: 5
30+
labels:
31+
- "dependency-update"
32+
# - title: "🚨🚨 Security Fixes 🚨🚨"
33+
# labels:
34+
# - "security"
35+
36+
37+
include-labels:
38+
- "bugfix"
39+
- "new-feature"
40+
- "breaking-change"
41+
42+
no-changes-template: '- No changes'
43+
44+
template: |
45+
## What's Changed
46+
47+
$CHANGES
48+
49+
**Full Changelog**: https://github.com/ApolloAutomation/R_PRO-1/compare/$PREVIOUS_TAG...$RESOLVED_VERSION.1
50+
51+
Be sure to 🌟 this repository for updates!

.github/workflows/autoassign.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Auto Assign
2+
on:
3+
issues:
4+
types: [opened]
5+
pull_request:
6+
types: [opened]
7+
jobs:
8+
run:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
pull-requests: write
13+
steps:
14+
- name: 'Auto-assign issue'
15+
uses: pozil/auto-assign-issue@v1
16+
with:
17+
repo-token: ${{ secrets.GITHUB_TOKEN }}
18+
assignees: TrevorSchirmer
19+
numOfAssignee: 1

.github/workflows/build.yml

Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
name: Publish
2+
env:
3+
DEVICE_NAME: r_pro-1
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
# Uncomment if needed:
10+
# workflow_dispatch:
11+
# inputs:
12+
# version:
13+
# description: 'The version of the firmware to build'
14+
# required: true
15+
# release:
16+
# types: [published]
17+
18+
jobs:
19+
check-for-yaml:
20+
name: Check for YAML Changes
21+
runs-on: ubuntu-latest
22+
outputs:
23+
yaml_changed: ${{ steps.check.outputs.yaml_changed }}
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v3
27+
with:
28+
fetch-depth: 2 # So we can diff the previous commit
29+
30+
- name: Find .yaml Changes in Last PR Merge
31+
id: check
32+
run: |
33+
BASE_COMMIT=$(git rev-parse HEAD^1)
34+
MERGE_COMMIT=$(git rev-parse HEAD)
35+
36+
if git diff --name-only $BASE_COMMIT $MERGE_COMMIT | grep -q '\.yaml$'; then
37+
echo "yaml_changed=true" >> $GITHUB_OUTPUT
38+
else
39+
echo "yaml_changed=false" >> $GITHUB_OUTPUT
40+
fi
41+
42+
set-version:
43+
name: Set Version
44+
runs-on: ubuntu-latest
45+
needs: [check-for-yaml]
46+
if: needs.check-for-yaml.outputs.yaml_changed == 'true'
47+
48+
# Expose job-level outputs so other jobs can access them
49+
outputs:
50+
version: ${{ steps.read_version.outputs.version }}
51+
upload_url: ${{ steps.run-release-drafter.outputs.upload_url }}
52+
body: ${{ steps.run-release-drafter.outputs.body }}
53+
html_url: ${{ steps.run-release-drafter.outputs.html_url }}
54+
permissions:
55+
contents: write
56+
pages: write
57+
id-token: write
58+
pull-requests: write
59+
60+
steps:
61+
- name: Checkout code
62+
uses: actions/checkout@v3
63+
64+
- name: Read version from YAML file
65+
id: read_version
66+
run: |
67+
version=$(awk '/substitutions:/ {found=1} found && /version:/ {print $2; exit}' Integrations/ESPHome/Core.yaml | tr -d '"')
68+
echo "version=$version" >> $GITHUB_OUTPUT
69+
echo "Detected version: $version"
70+
71+
- name: Fetch Last Merged PR Body
72+
id: last_pr
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
run: |
76+
PR_INFO=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
77+
"https://api.github.com/repos/${{ github.repository }}/pulls?state=closed&sort=updated&direction=desc&per_page=1")
78+
PR_BODY=$(echo "$PR_INFO" | jq -r '.[0].body')
79+
echo "$PR_BODY" > pr_body.txt
80+
81+
- name: 🚀 Run Release Drafter
82+
id: run-release-drafter
83+
uses: release-drafter/release-drafter@v6
84+
with:
85+
version: ${{ steps.read_version.outputs.version }}
86+
publish: true
87+
tag: ${{ steps.read_version.outputs.version }}
88+
name: Release ${{ steps.read_version.outputs.version }}
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
92+
build-firmware-e:
93+
name: Build And Release (Firmware)
94+
uses: esphome/workflows/.github/workflows/build.yml@main
95+
needs:
96+
- check-for-yaml
97+
- set-version
98+
if: needs.check-for-yaml.outputs.yaml_changed == 'true'
99+
with:
100+
files: |
101+
Integrations/ESPHome/R_PRO-1_ETH.yaml
102+
esphome-version: stable
103+
combined-name: firmware-e
104+
release-summary: ${{ needs.set-version.outputs.body }}
105+
release-version: ${{ needs.set-version.outputs.version }}
106+
107+
build-firmware-w:
108+
name: Build And Release (Firmware W)
109+
uses: esphome/workflows/.github/workflows/build.yml@main
110+
needs:
111+
- check-for-yaml
112+
- set-version
113+
if: needs.check-for-yaml.outputs.yaml_changed == 'true'
114+
with:
115+
files: |
116+
Integrations/ESPHome/R_PRO-1_W.yaml
117+
esphome-version: stable
118+
combined-name: firmware-w
119+
release-summary: ${{ needs.set-version.outputs.body }}
120+
release-url: ${{ needs.set-version.outputs.html_url }}
121+
release-version: ${{ needs.set-version.outputs.version }}
122+
123+
build-site:
124+
name: Build Site
125+
runs-on: ubuntu-latest
126+
needs:
127+
- check-for-yaml
128+
- build-firmware-e
129+
- build-firmware-w
130+
- set-version
131+
if: needs.check-for-yaml.outputs.yaml_changed == 'true'
132+
steps:
133+
- name: Checkout source code
134+
uses: actions/checkout@v4
135+
136+
- name: Build
137+
uses: actions/[email protected]
138+
with:
139+
source: ./static
140+
destination: ./output
141+
142+
- name: Upload
143+
uses: actions/upload-artifact@v4
144+
with:
145+
name: site
146+
path: output
147+
148+
publish:
149+
name: Publish to GitHub Pages
150+
runs-on: ubuntu-latest
151+
needs:
152+
- build-site
153+
- build-firmware-e
154+
- build-firmware-w
155+
- set-version
156+
if: needs.check-for-yaml.outputs.yaml_changed == 'true' && ${{ github.run_attempt == 1 }}
157+
permissions:
158+
contents: write
159+
pages: write
160+
id-token: write
161+
steps:
162+
- name: Checkout code
163+
uses: actions/checkout@v3
164+
165+
# 1) Download Firmware
166+
- uses: actions/download-artifact@v4
167+
with:
168+
name: firmware-e
169+
path: firmware-e
170+
171+
# 2) Download Firmware-B
172+
- uses: actions/download-artifact@v4
173+
with:
174+
name: firmware-w
175+
path: firmware-w
176+
177+
# 3) Zip them up
178+
- name: Zip firmware
179+
run: |
180+
zip -r firmware-e.zip firmware-e
181+
zip -r firmware-w.zip firmware-w
182+
183+
# 4) Upload firmware.zip as an asset
184+
- name: Upload firmware.zip
185+
id: upload-firmware
186+
uses: actions/upload-release-asset@v1
187+
env:
188+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
189+
with:
190+
# Use the job-level output from set-version:
191+
upload_url: ${{ needs.set-version.outputs.upload_url }}
192+
asset_path: firmware-e.zip
193+
asset_name: firmware-e.zip
194+
asset_content_type: application/zip
195+
196+
# 5) Upload firmware-w.zip
197+
- name: Upload firmware-w.zip
198+
id: upload-firmware-w
199+
uses: actions/upload-release-asset@v1
200+
env:
201+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
202+
with:
203+
# Use the job-level output from set-version:
204+
upload_url: ${{ needs.set-version.outputs.upload_url }}
205+
asset_path: firmware-w.zip
206+
asset_name: firmware-w.zip
207+
asset_content_type: application/zip
208+
209+
- name: Copy firmware and manifest
210+
run: |-
211+
mkdir -p output/firmware-e
212+
cp -r firmware-e/${{ needs.build-firmware-e.outputs.version }}/* output/firmware-e/
213+
214+
- name: Copy firmware and manifest
215+
run: |-
216+
mkdir -p output/firmware-w
217+
cp -r firmware-w/${{ needs.build-firmware-w.outputs.version }}/* output/firmware-w/
218+
219+
- uses: actions/download-artifact@v4
220+
with:
221+
name: site
222+
path: output
223+
224+
- uses: actions/upload-pages-artifact@v3
225+
with:
226+
path: output
227+
retention-days: 1
228+
229+
- name: Setup Pages
230+
uses: actions/configure-pages@v5
231+
232+
- name: Deploy to GitHub Pages
233+
id: deployment
234+
uses: actions/deploy-pages@v4

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
schedule:
6+
- cron: '0 0 * * 1'
7+
8+
jobs:
9+
ci:
10+
name: Building ${{ matrix.file }}
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
file:
15+
- Integrations/ESPHome/R_PRO-1_ETH.yaml
16+
- Integrations/ESPHome/R_PRO-1_W.yaml
17+
esphome-version:
18+
- stable
19+
- beta
20+
- dev
21+
steps:
22+
- name: Checkout source code
23+
uses: actions/[email protected]
24+
- name: Build ESPHome firmware to verify configuration
25+
uses: esphome/build-action@v6
26+
with:
27+
yaml-file: ${{ matrix.file }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11

22
Integrations/.DS_Store
33
.DS_Store
4+
.DS_Store

0 commit comments

Comments
 (0)