Skip to content

Commit d09a170

Browse files
committed
release workflow
1 parent b17d189 commit d09a170

File tree

5 files changed

+166
-28
lines changed

5 files changed

+166
-28
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## Summary
2+
3+
- Briefly describe the change and its motivation.
4+
- Link related issues (e.g., closes #123).
5+
6+
## Type of Change
7+
8+
- [ ] Bug fix (non-breaking change that fixes an issue)
9+
- [ ] New feature (non-breaking change that adds functionality)
10+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
11+
- [ ] Refactor (code change that neither fixes a bug nor adds a feature)
12+
- [ ] Documentation update
13+
- [ ] Build/CI
14+
15+
## Details
16+
17+
- What does this PR change? Why?
18+
- Any context for reviewers to understand decisions and tradeoffs.
19+
20+
## Testing
21+
22+
- [ ] Builds locally
23+
- [ ] Unit tests added/updated
24+
- [ ] Tested on target hardware/device (if applicable)
25+
26+
Describe how you tested the changes. Include commands, logs, or screenshots if helpful.
27+
28+
## Compatibility / Breaking Changes
29+
30+
- Describe any API, ABI, or behavior changes.
31+
- Migration steps for users (if any).
32+
33+
## Risks and Mitigations
34+
35+
- Potential risks introduced by this change and how they’re mitigated.
36+
37+
## Checklist
38+
39+
- [ ] Code follows project style and conventions
40+
- [ ] All tests pass locally
41+
- [ ] Documentation updated (README, examples, comments)
42+
- [ ] No secrets, credentials, or sensitive data committed
43+
- [ ] Linked issue(s) and relevant context provided
44+
45+
## Environment
46+
47+
- Toolchain/SDK versions: (e.g., ESP-IDF/PlatformIO/GCC)
48+
- OS and version:
49+
- Other relevant environment details:

.github/workflows/ci.yml

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,12 @@ name: CI
33
on:
44
push:
55
branches: [ main, master ]
6-
tags: ['v*']
76
pull_request:
87
workflow_dispatch:
98

109
jobs:
11-
unit-tests:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v4
16-
17-
- name: Configure CMake
18-
run: cmake -S . -B build
19-
20-
- name: Build tests
21-
run: cmake --build build
22-
23-
- name: Run tests
24-
run: ctest --test-dir build --output-on-failure
25-
2610
build-examples:
2711
runs-on: ubuntu-latest
28-
needs: unit-tests
2912
strategy:
3013
fail-fast: false
3114
matrix:
@@ -56,20 +39,20 @@ jobs:
5639
for d in examples/*; do
5740
if [ -d "$d" ]; then
5841
echo "Building $d on ${{ matrix.board }} via PlatformIO CI"
42+
# Force C++17 for this project to satisfy library requirements
5943
pio ci "$d" \
6044
--board ${{ matrix.board }} \
6145
--lib="." \
6246
--project-option "build_unflags=-std=gnu++11" \
63-
--project-option "build_flags=-std=gnu++17"
47+
--project-option "build_flags=-std=gnu++17" \
48+
--project-option "lib_deps=ArduinoJson@>=7.0.0"
6449
fi
6550
done
6651
6752
arduino-cli:
6853
runs-on: ubuntu-latest
69-
needs: unit-tests
7054
env:
71-
ESP32_CORE_VERSION: 3.0.7
72-
ESP32_CORE_URL: https://espressif.github.io/arduino-esp32/package_esp32_index.json
55+
ESP32_CORE_VERSION: 3.3.3
7356
ARDUINO_BOARDS: |
7457
esp32:esp32:esp32 esp32dev
7558
esp32:esp32:esp32s3 esp32-s3-devkitc-1
@@ -99,13 +82,13 @@ jobs:
9982
10083
- name: Install ESP32 core
10184
run: |
102-
set -e
103-
arduino-cli core update-index --additional-urls "${ESP32_CORE_URL}"
104-
# Retry once to dodge transient network drops/timeouts on large downloads
105-
if ! arduino-cli core install --additional-urls "${ESP32_CORE_URL}" "esp32:esp32@${ESP32_CORE_VERSION}"; then
106-
echo "Retrying ESP32 core install after transient failure..."
107-
arduino-cli core install --additional-urls "${ESP32_CORE_URL}" "esp32:esp32@${ESP32_CORE_VERSION}"
108-
fi
85+
arduino-cli core update-index
86+
arduino-cli core install esp32:esp32@${ESP32_CORE_VERSION}
87+
88+
- name: Install libraries
89+
run: |
90+
arduino-cli lib update-index
91+
arduino-cli lib install "ArduinoJson"
10992
11093
- name: Add local library to sketchbook
11194
run: |

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
create-release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Extract changelog entry
18+
id: changelog
19+
uses: actions/github-script@v7
20+
with:
21+
result-encoding: string
22+
script: |
23+
const tag = process.env.GITHUB_REF_NAME || '';
24+
const version = tag.startsWith('v') ? tag.slice(1) : tag;
25+
const fs = require('node:fs');
26+
const changelog = fs.readFileSync('CHANGELOG.md', 'utf8');
27+
const heading = `## [${version}]`;
28+
const start = changelog.indexOf(heading);
29+
let entry;
30+
if (start === -1) {
31+
entry = `No changelog entry found for version ${version}.`;
32+
} else {
33+
const afterHeading = start + heading.length;
34+
const nextHeader = changelog.indexOf('\n## [', afterHeading);
35+
const sliceEnd = nextHeader === -1 ? changelog.length : nextHeader;
36+
entry = changelog.slice(start, sliceEnd).trim();
37+
}
38+
return entry;
39+
40+
- name: Create GitHub Release
41+
uses: softprops/action-gh-release@v2
42+
with:
43+
draft: false
44+
prerelease: false
45+
generate_release_notes: false
46+
body: ${{ steps.changelog.outputs.result }}
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)