Skip to content

Commit 8271195

Browse files
committed
Prepare release v0.0.1
1 parent 556e545 commit 8271195

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

scripts/release.sh

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,30 @@ if [[ ! $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
1414
exit 1
1515
fi
1616

17+
# Find repo root (directory containing .git)
18+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
19+
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
20+
21+
# Verify we found the repo root
22+
if [ ! -d "$REPO_ROOT/.git" ]; then
23+
echo "Error: Could not find repository root (no .git directory)"
24+
exit 1
25+
fi
26+
27+
if [ ! -d "$REPO_ROOT/sensors/blackbox" ]; then
28+
echo "Error: Could not find sensors/blackbox directory"
29+
exit 1
30+
fi
31+
1732
echo "======================================"
1833
echo "Building Blackbox Release $VERSION"
1934
echo "======================================"
2035
echo ""
36+
echo "Repository: $REPO_ROOT"
37+
echo ""
2138

2239
# Navigate to firmware directory
23-
cd sensors/blackbox
40+
cd "$REPO_ROOT/sensors/blackbox"
2441

2542
# Build optimized firmware
2643
echo "📦 Building optimized firmware..."
@@ -47,7 +64,7 @@ if [ $? -ne 0 ]; then
4764
exit 1
4865
fi
4966

50-
echo "✅ Binary created: sensors/blackbox/blackbox-${VERSION}.bin"
67+
echo "✅ Binary created: $REPO_ROOT/sensors/blackbox/blackbox-${VERSION}.bin"
5168
echo ""
5269

5370
# Get binary size
@@ -59,11 +76,11 @@ echo "======================================"
5976
echo "Release build complete!"
6077
echo "======================================"
6178
echo ""
62-
echo "Binary location: sensors/blackbox/blackbox-${VERSION}.bin"
79+
echo "Binary location: $REPO_ROOT/sensors/blackbox/blackbox-${VERSION}.bin"
6380
echo ""
6481
echo "Next steps:"
6582
echo "1. Test the binary:"
66-
echo " espflash write-bin 0x0 sensors/blackbox/blackbox-${VERSION}.bin"
83+
echo " espflash write-bin 0x0 $REPO_ROOT/sensors/blackbox/blackbox-${VERSION}.bin"
6784
echo ""
6885
echo "2. Commit any remaining changes:"
6986
echo " git add ."
@@ -79,6 +96,7 @@ echo " git tag -a ${VERSION} -m 'Release ${VERSION} - Access Point Mode + Mobi
7996
echo " git push origin ${VERSION}"
8097
echo ""
8198
echo "5. Create GitHub release with binary:"
99+
echo " cd $REPO_ROOT"
82100
echo " gh release create ${VERSION} \\"
83101
echo " --title '${VERSION} - Access Point Mode + Mobile Dashboard' \\"
84102
echo " --notes-file release-notes.md \\"

0 commit comments

Comments
 (0)