Repository navigation
78 lines (68 loc) · 3 KB
/
Copy pathrelease.yml
File metadata and controls
78 lines (68 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Compile Release
on:
push:
tags:
- '*'
permissions:
contents: write
jobs:
build-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Verify tag matches platformio.ini version
# Catches tagging a release before the version bump commit lands (happened
# for 1.4.1 and 1.9.0) - a mismatch here means the binary would report the
# wrong PICOREAD_VERSION, so fail loudly instead of silently publishing it.
run: |
TAG="${GITHUB_REF_NAME}"
INI_VERSION=$(grep -m1 '^version' platformio.ini | sed -E 's/^version\s*=\s*//')
if [ "$TAG" != "$INI_VERSION" ]; then
echo "::error::Tag '$TAG' does not match platformio.ini version '$INI_VERSION' - bump the version before tagging."
exit 1
fi
- uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "latest"
enable-cache: false
- name: Install PlatformIO Core
run: uv pip install --system -U https://github.com/pioarduino/platformio-core/archive/refs/tags/v6.1.19.zip
- name: Cache PlatformIO packages
uses: actions/cache@v4
with:
path: ~/.platformio
key: pio-${{ runner.os }}-${{ hashFiles('platformio.ini') }}
restore-keys: pio-${{ runner.os }}-
- name: Build PicoRead
run: pio run -e gh_release
- name: Prepare update.bin for the OEM bootloader's SD recovery flow
# The stock Xteink/CrossPoint bootloader can flash an app image straight
# from the SD card root (hold Power+Up at boot) if it's named exactly
# "update.bin" - same app-partition image format as firmware.bin, just a
# renamed copy so it's discoverable that way too, no USB/computer needed.
run: cp .pio/build/gh_release/firmware.bin .pio/build/gh_release/update.bin
- name: Create or update GitHub Release
uses: softprops/action-gh-release@v2
with:
# Asset names are intentionally version-agnostic and unrenamed:
# - firmware.bin is the exact name OtaUpdater.cpp/ReleaseJsonParser look for
# when checking /releases/latest for an update.
# - bootloader.bin/partitions.bin/firmware.bin together are what
# unique-esp-web-flasher mirrors from /releases/latest/download/... - stable
# names mean its manifest never needs editing for a new release.
# - update.bin is firmware.bin under the OEM bootloader's expected filename.
files: |
.pio/build/gh_release/bootloader.bin
.pio/build/gh_release/firmware.bin
.pio/build/gh_release/firmware.elf
.pio/build/gh_release/firmware.map
.pio/build/gh_release/partitions.bin
.pio/build/gh_release/update.bin
generate_release_notes: true
fail_on_unmatched_files: true