-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build action and new-style version info
- Loading branch information
Showing
3 changed files
with
87 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// This file is part of the DMComm project by BladeSabre. License: MIT. | ||
|
||
// This file is intended to be overwritten by the build CI. | ||
// Does not have its own include guards, should be checked by includer. | ||
|
||
#define DMCOMM_BUILD_INFO F("name = dmcomm-original") |