fork/GramFirmware

git clone https://git.julia.blue/fork/GramFirmware

Jonathan Haylettbuild: fix artifact file names0487bd6

v0.1.0
2.1 KiB74 linesraw
1name: PlatformIO CI
2
3on: [push]
4
5jobs:
6  build:
7    runs-on: ubuntu-latest
8    permissions:
9      contents: write
10    env:
11      VERSION_REF: ${{ github.ref_type == 'tag' && github.ref_name || github.sha }}
12    strategy:
13        matrix:
14          include:
15            - env: c53
16              bin_ext: uf2
17            - env: pico
18              bin_ext: uf2
19            - env: arduino_uno
20              bin_ext: hex
21            - env: arduino_nano
22              bin_ext: hex
23            - env: arduino_mega
24              bin_ext: hex
25            - env: arduino_leonardo
26              bin_ext: hex
27            - env: arduino_micro
28              bin_ext: hex
29            - env: b0xx_r1
30              bin_ext: hex
31            - env: b0xx_r2
32              bin_ext: hex
33            - env: gccmx
34              bin_ext: hex
35            - env: gccpcb1
36              bin_ext: hex
37            - env: gccpcb2
38              bin_ext: hex
39            - env: lbx
40              bin_ext: hex
41            - env: smashbox
42              bin_ext: hex
43
44    steps:
45    - name: Check out source code
46      uses: actions/checkout@v3
47
48    - name: Set up Python
49      uses: actions/setup-python@v4
50      with:
51        python-version: '3.10'
52
53    - name: Install PlatformIO
54      run: |
55        python -m pip install --upgrade pip
56        pip install --upgrade platformio
57
58    - name: Build ${{ matrix.env }} env
59      run: |
60        pio run -e ${{ matrix.env }}
61        mkdir -p ${{ matrix.env }}
62        cp .pio/build/${{ matrix.env }}/firmware.${{ matrix.bin_ext }} ${{ matrix.env }}/HayBox-${{ env.VERSION_REF }}-${{ matrix.env }}.${{ matrix.bin_ext }}
63
64    - name: Publish ${{ matrix.env }} artifacts
65      uses: actions/upload-artifact@v3
66      with:
67        name: HayBox-${{ env.VERSION_REF }}-${{ matrix.env }}.${{ matrix.bin_ext }}
68        path: ${{ matrix.env }}/HayBox-${{ env.VERSION_REF }}-${{ matrix.env }}.${{ matrix.bin_ext }}
69
70    - name: Upload binaries to release
71      uses: softprops/action-gh-release@v1
72      if: github.ref_type == 'tag'
73      with:
74        files: ${{ matrix.env }}/HayBox-${{ env.VERSION_REF }}-${{ matrix.env }}.${{ matrix.bin_ext }}