-
-
Notifications
You must be signed in to change notification settings - Fork 239
91 lines (81 loc) · 2.3 KB
/
build.yml
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
86
87
88
89
90
91
name: PlatformIO CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
env:
VERSION_REF: ${{ github.ref_type == 'tag' && github.ref_name || github.sha }}
PIO_ENV: ${{ matrix.env }}
BIN_EXT: ${{ matrix.bin_ext }}
strategy:
fail-fast: false
matrix:
include:
- env: c53
bin_ext: uf2
- env: b0xx_r4
bin_ext: uf2
- env: glyph
bin_ext: uf2
- env: pico
bin_ext: uf2
- env: schism
bin_ext: uf2
- env: arduino_uno
bin_ext: hex
- env: arduino_nano
bin_ext: hex
- env: arduino_mega
bin_ext: hex
- env: arduino_leonardo
bin_ext: hex
- env: arduino_micro
bin_ext: hex
- env: b0xx_r1
bin_ext: hex
- env: b0xx_r2
bin_ext: hex
- env: gccmx
bin_ext: hex
- env: gccpcb1
bin_ext: hex
- env: gccpcb2
bin_ext: hex
- env: lbx
bin_ext: hex
- env: smashbox
bin_ext: hex
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Set artifact filename environment variable
run: |
echo "ARTIFACT_NAME=HayBox-${VERSION_REF}-${PIO_ENV}.${BIN_EXT}" >> "$GITHUB_ENV"
- name: Set artifact path environment variable
run: |
echo "ARTIFACT_PATH=${PIO_ENV}/${ARTIFACT_NAME}" >> "$GITHUB_ENV"
- name: Build ${{ matrix.env }} env
run: |
pio run -e "$PIO_ENV"
mkdir -p "$PIO_ENV"
cp ".pio/build/${PIO_ENV}/firmware.${BIN_EXT}" "$ARTIFACT_PATH"
- name: Publish ${{ matrix.env }} artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_PATH }}
- name: Upload binaries to release
uses: softprops/action-gh-release@v1
if: github.ref_type == 'tag'
with:
files: ${{ env.ARTIFACT_PATH }}