Skip to content

Commit d624bab

Browse files
committed
workflow
1 parent 66d32ba commit d624bab

1 file changed

Lines changed: 16 additions & 17 deletions

File tree

.github/workflows/main.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ name: PlatformIO Auto Release
22

33
on:
44
push:
5-
branches: [ main ] # runs automatically on every push to main
5+
branches: [ main ]
6+
7+
permissions:
8+
contents: write
69

710
jobs:
811
build:
@@ -19,33 +22,29 @@ jobs:
1922
with:
2023
python-version: '3.x'
2124

22-
- name: Cache pip
23-
uses: actions/cache@v4
24-
with:
25-
path: ~/.cache/pip
26-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
27-
restore-keys: |
28-
${{ runner.os }}-pip-
29-
30-
- name: Cache PlatformIO
25+
- name: Cache dependencies
3126
uses: actions/cache@v4
3227
with:
33-
path: ~/.platformio
34-
key: ${{ runner.os }}-platformio-${{ hashFiles('**/platformio.ini') }}
28+
path: |
29+
~/.cache/pip
30+
~/.platformio
31+
key: ${{ runner.os }}-pio-${{ hashFiles('platformio.ini') }}
3532
restore-keys: |
36-
${{ runner.os }}-platformio-
33+
${{ runner.os }}-pio-
3734
3835
- name: Install PlatformIO
39-
run: pip install platformio
36+
run: |
37+
pip install -U platformio
38+
pio update
4039
4140
- name: Build firmware
4241
run: pio run
4342

4443
- name: Prepare firmware output
4544
run: |
46-
mkdir output
47-
find .pio/build -name "firmware.bin" -exec bash -c 'cp "$0" "output/${0%/*}.bin"' {} \;
48-
ls -lh output
45+
mkdir -p output
46+
cp $(find .pio/build -name firmware.bin) output/ || echo "⚠️ No firmware files found"
47+
ls -lh output || true
4948
5049
- name: Auto increment release tag
5150
id: tag

0 commit comments

Comments
 (0)