-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (39 loc) · 1.22 KB
/
build.yaml
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
name: Build Firmware
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
teensy: ['32', '40']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
git fetch --prune --unshallow --tags
git describe --dirty --tags
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
pip install platformio
- name: Build firmware
run: |
make teensy${{ matrix.teensy }}
git_describe=$(git describe --tags --dirty)
cp .pio/build/teensy${{ matrix.teensy }}/firmware.hex firmware_teensy${{ matrix.teensy }}-${git_describe}.hex
cp .pio/build/teensy${{ matrix.teensy }}/firmware.hex firmware_teensy${{ matrix.teensy }}.hex
- name: Upload artifact
if: always()
uses: actions/upload-artifact@v3
with:
path: |
firmware_teensy${{ matrix.teensy }}.hex
- name: Upload firmware to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./firmware_teensy*.hex
tag: ${{ github.ref }}
overwrite: true
file_glob: true
if: startsWith(github.ref, 'refs/tags/')