Skip to content

Commit 65a362d

Browse files
committed
ci: added ci to publish lib to pio registry
1 parent afc4df1 commit 65a362d

File tree

2 files changed

+62
-2
lines changed

2 files changed

+62
-2
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Publish ESP32TFLMWrapper to PlatformIO Registry
2+
3+
on:
4+
push:
5+
branches: [ publish ]
6+
pull_request:
7+
branches: [ publish ]
8+
types: [ closed ]
9+
10+
jobs:
11+
publish:
12+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.x'
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install platformio
27+
28+
- name: Setup PlatformIO authentication
29+
run: |
30+
mkdir -p ~/.platformio
31+
echo "[auth]" > ~/.platformio/auth.ini
32+
echo "token = ${{ secrets.PIO_AUTH_KEY }}" >> ~/.platformio/auth.ini
33+
34+
- name: Publish to PlatformIO Registry
35+
run: |
36+
# First check if library.json exists
37+
if [ ! -f "library.json" ]; then
38+
echo "Error: library.json not found!"
39+
exit 1
40+
fi
41+
42+
# Attempt to publish
43+
echo "Publishing library to PlatformIO Registry..."
44+
pio package publish --no-interactive 2>&1 | tee publish_output.log
45+
46+
# Check if publish was successful
47+
if [ ${PIPESTATUS[0]} -eq 0 ]; then
48+
echo "Successfully published to PlatformIO Registry!"
49+
else
50+
echo "Failed to publish library"
51+
cat publish_output.log
52+
exit 1
53+
fi
54+
55+
- name: Upload publish log
56+
if: always()
57+
uses: actions/upload-artifact@v3
58+
with:
59+
name: publish-log
60+
path: publish_output.log

library.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "ESP32TFLMWrapper",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "Abstract away all the low level complexity of TensorFlow Lite Micro and makes it really easy to deploy TFLM models and logs per ops wise execution time on supported ESP32 boards.",
5-
"keywords": "ESP32, ESP32-S3, TensorFlow, TFLM, TFLiteMicro, TensorFlow Lite Micro, arduino, esp32 arduino, ops wise metrics",
5+
"keywords": "ESP32, ESP32-S3, TensorFlow, TFLM, TFLiteMicro, operation, TensorFlow Lite Micro, arduino, esp32 arduino, ops wise metrics",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/arrhythmia-detection/ESP32TFMicro.git"

0 commit comments

Comments
 (0)