Skip to content

Commit

Permalink
build firmware in ci (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
jandelgado authored Apr 14, 2021
1 parent 23f1ca8 commit a144e31
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
push:
branches:
- main
pull_request:
branches:
- main

name: build firmware
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2

- name: linter
run: |
pip install cpplint
make lint
build:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2

- name: install platformio
run: |
pip install platformio==5.0.3
- name: build firmware
run: |
export PLATFORMIO_BUILD_DIR=$HOME/build
make ci
mkdir firmware
cp $PLATFORMIO_BUILD_DIR/pro16MHzatmega328/firmware.hex firmware/
- name: upload artifacts
uses: actions/upload-artifact@master
with:
name: firmware
path: firmware/

30 changes: 30 additions & 0 deletions .github/workflows/upload_assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
release:
types: [created]

name: Upload release assets after release is created
jobs:
build:
name: create assets
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: install platformio
run: |
pip install platformio==5.0.3
- name: build firmware
run: |
export PLATFORMIO_BUILD_DIR=$HOME/build
make ci
mkdir firmware
cp $PLATFORMIO_BUILD_DIR/pro16MHzatmega328/firmware.hex firmware/
- name: Upload release assets
uses: skx/github-action-publish-binaries@c881a3f8ffb80b684f367660178d38ceabc065c2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: './firmware/*'
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Carl music box

[![build firmware](https://github.com/jandelgado/carl/actions/workflows/build.yml/badge.svg)](https://github.com/jandelgado/carl/actions/workflows/build.yml)

This is the firmware repository for the Carl music box. Details will follow
shortly.

Expand Down

0 comments on commit a144e31

Please sign in to comment.