-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (66 loc) · 2.04 KB
/
make-hex.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
name: Compile Arduino files to hex
on:
push:
pull_request:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- label: "uno"
fqbn: "arduino:avr:uno"
build-dir: "arduino.avr.uno"
- label: "nano"
fqbn: "arduino:avr:nano"
build-dir: "arduino.avr.nano"
- label: "leonardo"
fqbn: "arduino:avr:leonardo"
build-dir: "arduino.avr.leonardo"
- label: "atmega328pb"
fqbn: "MiniCore:avr:328:variant=modelPB"
build-dir: "MiniCore.avr.328"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Print ref
run: echo ${{ github.ref }}
- name: Set VERSION
run: echo "VERSION=$(git describe --tags --always)" >> $GITHUB_ENV
- name: Set HEX_FILENAME
run: echo "HEX_FILENAME=dmcomm-original-${{ env.VERSION }}-${{ matrix.label }}.hex" >> $GITHUB_ENV
- name: Write build info
run: >
echo '#define DMCOMM_BUILD_INFO
F("name = dmcomm-original\r\nversion = ${{ env.VERSION }}\r\nboard = ${{ matrix.label }}")'
> dmcomm/dmcomm_build_info.h
- name: Compile sketch
uses: arduino/compile-sketches@v1
with:
fqbn: "${{ matrix.fqbn }}"
sketch-paths: |
- dmcomm
libraries:
cli-compile-flags: |
- --export-binaries
platforms: |
- name: "arduino:avr"
- name: "MiniCore:avr"
source-url: "https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json"
- name: Copy hex
run: cp dmcomm/build/${{ matrix.build-dir }}/dmcomm.ino.hex ${{ env.HEX_FILENAME }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.label }}
path: ${{ env.HEX_FILENAME }}
- name: Attach to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: ${{ env.HEX_FILENAME }}