Skip to content

Commit dd5b509

Browse files
Initial commit of some workflow stuff to help with releases later
Signed-off-by: Cole Gentry <peapod2007@gmail.com>
1 parent bf9ec42 commit dd5b509

File tree

7 files changed

+679
-3
lines changed

7 files changed

+679
-3
lines changed

.github/RELEASE_GUIDE.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Release Guide
2+
3+
This guide explains how to create releases for the Pi-Arduino Digital Dash project.
4+
5+
## Automated Release Process
6+
7+
Releases are automatically created when you push a version tag to GitHub.
8+
9+
### Creating a Release
10+
11+
1. **Ensure your code is ready**
12+
- All changes committed and pushed to `main` branch
13+
- Arduino sketches compile successfully
14+
- Documentation is up to date
15+
16+
2. **Create and push a version tag**
17+
```bash
18+
git tag -a v1.0.0 -m "Release version 1.0.0"
19+
git push origin v1.0.0
20+
```
21+
22+
3. **GitHub Actions will automatically:**
23+
- Compile both Arduino sketches for Mega 2560
24+
- Package all files (hex files, source code, INI, documentation)
25+
- Create SHA256 checksums
26+
- Generate release notes
27+
- Create a GitHub Release with all assets
28+
29+
### Version Tag Format
30+
31+
Use semantic versioning: `vMAJOR.MINOR.PATCH`
32+
33+
- `v1.0.0` - Initial stable release
34+
- `v1.1.0` - Minor feature additions
35+
- `v1.0.1` - Bug fixes and patches
36+
- `v2.0.0` - Major changes or breaking changes
37+
38+
### Release Contents
39+
40+
Each release includes:
41+
- **ZIP package** containing everything
42+
- **Compiled .hex files** for direct upload to Arduino
43+
- **Source .ino files** for customization
44+
- **TunerStudio INI configuration**
45+
- **All documentation** (README, CANBUS guide, CLAUDE.md)
46+
- **SHA256 checksums** for verification
47+
48+
## Continuous Integration
49+
50+
### On Every Push/PR to Main
51+
52+
The following checks run automatically:
53+
54+
1. **Arduino Compilation** (`arduino-compile.yml`)
55+
- Compiles both sketches
56+
- Ensures code builds without errors
57+
- Artifacts available for 30 days
58+
59+
2. **Documentation Validation** (`validate-docs.yml`)
60+
- Verifies all required files exist
61+
- Checks signature consistency (`speeduino-travis`)
62+
- Validates baud rate settings (115200)
63+
64+
## Manual Release (Without Tags)
65+
66+
If you need to create a release manually without using tags:
67+
68+
1. Go to your repository on GitHub
69+
2. Click "Releases" → "Draft a new release"
70+
3. Create a new tag (e.g., `v1.0.0`)
71+
4. The release workflow will trigger automatically
72+
73+
## Troubleshooting
74+
75+
### Workflow Fails on Compilation
76+
- Check that your sketches compile locally in Arduino IDE
77+
- Ensure all required libraries are specified in the workflow
78+
- Review error logs in Actions tab
79+
80+
### Release Not Creating
81+
- Verify tag format starts with `v` (e.g., `v1.0.0`, not `1.0.0`)
82+
- Check repository permissions (workflows need `contents: write`)
83+
- Ensure you're pushing tags: `git push origin --tags`
84+
85+
### Missing Files in Release
86+
- Update `release.yml` to include additional files in the `Create release package` step
87+
- Ensure files are committed to the repository before tagging
88+
89+
## Best Practices
90+
91+
1. **Test before tagging**: Ensure sketches compile and upload successfully
92+
2. **Update version strings**: Update version info in `.ino` files if needed
93+
3. **Document changes**: Update README or add notes about what's new
94+
4. **Verify artifacts**: Download and test the release package after creation
95+
5. **Delete failed tags**: If a release fails, delete the tag and fix issues before re-tagging
96+
```bash
97+
git tag -d v1.0.0 # Delete locally
98+
git push origin :refs/tags/v1.0.0 # Delete remotely
99+
```
100+
101+
## Example Release Workflow
102+
103+
```bash
104+
# Make your changes
105+
git add .
106+
git commit -m "Add new sensor calibration for oil temp"
107+
git push origin main
108+
109+
# Wait for CI checks to pass (check Actions tab)
110+
111+
# Create release
112+
git tag -a v1.2.0 -m "Add improved oil temp calibration"
113+
git push origin v1.2.0
114+
115+
# Watch the release workflow in Actions tab
116+
# Release will appear in the Releases section when complete
117+
```
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Arduino Sketch Compilation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
compile-sketches:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
sketch:
16+
- travis.cea_Digital_Dash.ino
17+
- Haltech_To_Arduino_DRAFT.ino
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Arduino CLI
24+
uses: arduino/setup-arduino-cli@v1
25+
26+
- name: Install Arduino Mega core
27+
run: |
28+
arduino-cli core update-index
29+
arduino-cli core install arduino:avr
30+
31+
- name: Install required libraries
32+
run: |
33+
arduino-cli lib install "MCP_CAN_lib"
34+
35+
- name: Compile ${{ matrix.sketch }}
36+
run: |
37+
arduino-cli compile --fqbn arduino:avr:mega:cpu=atmega2560 "${{ matrix.sketch }}"
38+
39+
- name: Upload compilation artifacts
40+
uses: actions/upload-artifact@v4
41+
if: success()
42+
with:
43+
name: ${{ matrix.sketch }}-hex
44+
path: |
45+
${{ matrix.sketch }}.hex
46+
${{ matrix.sketch }}.elf
47+
retention-days: 30

.github/workflows/release.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*' # Triggers on version tags like v1.0.0, v2.1.3, etc.
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-and-release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Arduino CLI
20+
uses: arduino/setup-arduino-cli@v1
21+
22+
- name: Install Arduino Mega core
23+
run: |
24+
arduino-cli core update-index
25+
arduino-cli core install arduino:avr
26+
27+
- name: Install required libraries
28+
run: |
29+
arduino-cli lib install "MCP_CAN_lib"
30+
31+
- name: Compile Main Sketch
32+
run: |
33+
arduino-cli compile --fqbn arduino:avr:mega:cpu=atmega2560 \
34+
--output-dir ./build/main \
35+
travis.cea_Digital_Dash.ino
36+
37+
- name: Compile Haltech Sketch
38+
run: |
39+
arduino-cli compile --fqbn arduino:avr:mega:cpu=atmega2560 \
40+
--output-dir ./build/haltech \
41+
Haltech_To_Arduino_DRAFT.ino
42+
43+
- name: Create release package
44+
run: |
45+
mkdir -p release-package
46+
47+
# Copy compiled hex files
48+
cp build/main/travis.cea_Digital_Dash.ino.hex release-package/
49+
cp build/haltech/Haltech_To_Arduino_DRAFT.ino.hex release-package/
50+
51+
# Copy source files
52+
cp travis.cea_Digital_Dash.ino release-package/
53+
cp Haltech_To_Arduino_DRAFT.ino release-package/
54+
55+
# Copy configuration and documentation
56+
cp travis.cea-TS-DASH-config-Final.ini release-package/
57+
cp README.md release-package/
58+
cp CANBUS_Communication_Setup.md release-package/
59+
cp CLAUDE.md release-package/
60+
cp .gitattributes release-package/ 2>/dev/null || true
61+
62+
# Create ZIP archive
63+
cd release-package
64+
zip -r ../Pi-Arduino-Digital-Dash-${{ github.ref_name }}.zip .
65+
cd ..
66+
67+
# Create checksums
68+
sha256sum Pi-Arduino-Digital-Dash-${{ github.ref_name }}.zip > checksums.txt
69+
70+
- name: Extract release notes
71+
id: extract-notes
72+
run: |
73+
# Extract version from tag
74+
VERSION="${{ github.ref_name }}"
75+
echo "version=$VERSION" >> $GITHUB_OUTPUT
76+
77+
# Create release notes
78+
cat > release-notes.md << 'EOF'
79+
## Pi-Arduino Digital Dash ${{ github.ref_name }}
80+
81+
### 📦 Release Contents
82+
83+
This release includes:
84+
- ✅ Compiled `.hex` files ready for Arduino Mega 2560
85+
- 📝 Source `.ino` files for both analog sensor and Haltech CANBUS versions
86+
- ⚙️ TunerStudio configuration file (`travis.cea-TS-DASH-config-Final.ini`)
87+
- 📖 Complete documentation (README, CANBUS setup guide, CLAUDE.md)
88+
89+
### 🚀 Quick Start
90+
91+
**For Pre-compiled Hex Upload:**
92+
1. Download `Pi-Arduino-Digital-Dash-${{ github.ref_name }}.zip`
93+
2. Extract the archive
94+
3. Use Arduino IDE or `avrdude` to flash the appropriate `.hex` file to your Arduino Mega 2560
95+
96+
**For Source Code Compilation:**
97+
1. Open the `.ino` file in Arduino IDE
98+
2. Install `MCP_CAN_lib` library (for Haltech version only)
99+
3. Select Board: "Arduino Mega or Mega 2560" with Processor: "ATmega2560"
100+
4. Upload to your board
101+
102+
### 📋 Hardware Requirements
103+
104+
- Raspberry Pi 5 with touchscreen
105+
- Arduino Mega 2560
106+
- MCP2515 CAN module (for Haltech/CANBUS version)
107+
- Appropriate sensors or CANBUS connection
108+
109+
See README.md for complete bill of materials and wiring instructions.
110+
111+
### 🔍 Verification
112+
113+
Verify your download with SHA256:
114+
```
115+
$(cat checksums.txt)
116+
```
117+
118+
### ⚠️ Important Notes
119+
120+
- The Haltech sketch is a **draft** and requires CANBUS frame ID customization for your specific ECU
121+
- Cut the red wire on the USB printer cable for data-only connection (no +5V backfeed)
122+
- Default signature: `speeduino-travis` @ 115200 baud
123+
124+
For detailed setup and troubleshooting, see [CLAUDE.md](https://github.com/${{ github.repository }}/blob/${{ github.ref_name }}/CLAUDE.md)
125+
EOF
126+
127+
- name: Create GitHub Release
128+
uses: softprops/action-gh-release@v1
129+
with:
130+
files: |
131+
Pi-Arduino-Digital-Dash-${{ github.ref_name }}.zip
132+
checksums.txt
133+
body_path: release-notes.md
134+
draft: false
135+
prerelease: false
136+
generate_release_notes: true
137+
env:
138+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
139+
140+
- name: Upload individual hex files as assets
141+
uses: softprops/action-gh-release@v1
142+
with:
143+
files: |
144+
build/main/travis.cea_Digital_Dash.ino.hex
145+
build/haltech/Haltech_To_Arduino_DRAFT.ino.hex
146+
env:
147+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Validate Documentation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
check-markdown:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Check Markdown files exist
18+
run: |
19+
echo "Checking for required documentation files..."
20+
test -f README.md || (echo "ERROR: README.md not found" && exit 1)
21+
test -f CANBUS_Communication_Setup.md || (echo "ERROR: CANBUS_Communication_Setup.md not found" && exit 1)
22+
test -f CLAUDE.md || (echo "ERROR: CLAUDE.md not found" && exit 1)
23+
echo "✓ All required documentation files present"
24+
25+
- name: Check Arduino sketches exist
26+
run: |
27+
echo "Checking for Arduino sketch files..."
28+
test -f travis.cea_Digital_Dash.ino || (echo "ERROR: travis.cea_Digital_Dash.ino not found" && exit 1)
29+
test -f Haltech_To_Arduino_DRAFT.ino || (echo "ERROR: Haltech_To_Arduino_DRAFT.ino not found" && exit 1)
30+
echo "✓ All Arduino sketch files present"
31+
32+
- name: Check INI configuration exists
33+
run: |
34+
echo "Checking for TunerStudio configuration..."
35+
test -f travis.cea-TS-DASH-config-Final.ini || (echo "ERROR: INI file not found" && exit 1)
36+
echo "✓ TunerStudio configuration file present"
37+
38+
- name: Validate signature in sketches
39+
run: |
40+
echo "Validating speeduino-travis signature in sketches..."
41+
42+
# Check main sketch
43+
if grep -q 'speeduino-travis' travis.cea_Digital_Dash.ino; then
44+
echo "✓ Signature found in main sketch"
45+
else
46+
echo "ERROR: Signature not found in main sketch"
47+
exit 1
48+
fi
49+
50+
# Check Haltech sketch
51+
if grep -q 'speeduino-travis' Haltech_To_Arduino_DRAFT.ino; then
52+
echo "✓ Signature found in Haltech sketch"
53+
else
54+
echo "ERROR: Signature not found in Haltech sketch"
55+
exit 1
56+
fi
57+
58+
- name: Validate INI signature match
59+
run: |
60+
echo "Validating INI signature matches sketch signature..."
61+
if grep -q 'speeduino-travis' travis.cea-TS-DASH-config-Final.ini; then
62+
echo "✓ Signature match confirmed in INI file"
63+
else
64+
echo "ERROR: Signature mismatch in INI file"
65+
exit 1
66+
fi
67+
68+
- name: Check baud rate consistency
69+
run: |
70+
echo "Checking baud rate consistency (115200)..."
71+
72+
# Check main sketch
73+
if grep -q '115200' travis.cea_Digital_Dash.ino; then
74+
echo "✓ Baud rate found in main sketch"
75+
else
76+
echo "WARNING: Default baud rate not found in main sketch"
77+
fi
78+
79+
# Check Haltech sketch
80+
if grep -q '115200' Haltech_To_Arduino_DRAFT.ino; then
81+
echo "✓ Baud rate found in Haltech sketch"
82+
else
83+
echo "WARNING: Default baud rate not found in Haltech sketch"
84+
fi

0 commit comments

Comments
 (0)