-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (80 loc) · 3.64 KB
/
Copy pathfirmware.yml
File metadata and controls
85 lines (80 loc) · 3.64 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
79
80
81
82
83
84
85
name: firmware
# Builds every Blipscope SKU. On a published GitHub Release it also attaches each SKU's
# binary as firmware-<slug>.bin plus a shared version.txt, which is what the on-device
# variant-aware OTA reads (the 1.46" downloads firmware-s3-146.bin, never another SKU's image).
# See RELEASING.md.
on:
push:
branches: [ main ]
pull_request:
release:
types: [ published ]
permissions:
contents: write # needed to upload release assets
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# One entry per SKU. `env` = PlatformIO env; `slug` MUST equal variant::SLUG in
# the variant header (it names the OTA asset). Add S3 SKUs here as they come online.
include:
- { env: blipscope-pro-s3-21, slug: s3-21 }
- { env: blipscope-s3-146, slug: s3-146 }
# FEATURE_EAM product: same boards, EAM monitor firmware, own OTA channel
# (firmware-eam-<slug>.bin -- the slug must match FW_OTA_PREFIX + variant::SLUG).
- { env: blipscope-eam-s3-146, slug: eam-s3-146 }
# FEATURE_SPACE product: same boards, Spacescope firmware, own OTA channel
# (firmware-space-<slug>.bin -- the slug must match FW_OTA_PREFIX + variant::SLUG).
- { env: blipscope-space-s3-146, slug: space-s3-146 }
# FEATURE_SEISMIC product: same boards, Seismic-edition firmware, own OTA channel
# (firmware-seismic-<slug>.bin -- the slug must match FW_OTA_PREFIX + variant::SLUG).
- { env: blipscope-seismic-s3-146, slug: seismic-s3-146 }
# FEATURE_BIRDING product: same boards, Birding-edition firmware, own OTA channel
# (firmware-birding-<slug>.bin -- the slug must match FW_OTA_PREFIX + variant::SLUG).
- { env: blipscope-birding-s3-146, slug: birding-s3-146 }
# FEATURE_ANGLER product: same boards, Angler-edition (solunar fishing) firmware, own OTA
# channel (firmware-angler-<slug>.bin -- the slug must match FW_OTA_PREFIX + variant::SLUG).
- { env: blipscope-angler-s3-146, slug: angler-s3-146 }
# - { env: blipscope-lite-s3-128, slug: s3-128 }
# - { env: blipscope-pro-s3-175-amoled, slug: s3-175-amoled }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install PlatformIO
run: pip install --upgrade platformio
- name: Build ${{ matrix.env }}
run: pio run -e ${{ matrix.env }}
- name: Name binary by slug
run: cp ".pio/build/${{ matrix.env }}/firmware.bin" "firmware-${{ matrix.slug }}.bin"
- name: Upload CI artifact
uses: actions/upload-artifact@v4
with:
name: firmware-${{ matrix.slug }}
path: firmware-${{ matrix.slug }}.bin
- name: Attach to release
if: github.event_name == 'release'
env:
GH_TOKEN: ${{ github.token }}
run: |
tag="${{ github.event.release.tag_name }}"
gh release upload "$tag" "firmware-${{ matrix.slug }}.bin" --clobber
version:
# Publish the shared version gate once per release, after all SKUs build.
if: github.event_name == 'release'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract FW_VERSION -> version.txt
run: |
v=$(grep -oP 'FW_VERSION\s*=\s*\K[0-9]+' src/OtaUpdater.h)
echo "FW_VERSION=$v"
echo "$v" > version.txt
- name: Publish version.txt
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload "${{ github.event.release.tag_name }}" version.txt --clobber