Skip to content

Commit a144e31

Browse files
authored
build firmware in ci (#2)
1 parent 23f1ca8 commit a144e31

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

.github/workflows/build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
branches:
7+
- main
8+
9+
name: build firmware
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: checkout code
15+
uses: actions/checkout@v2
16+
17+
- name: linter
18+
run: |
19+
pip install cpplint
20+
make lint
21+
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: checkout code
26+
uses: actions/checkout@v2
27+
28+
- name: install platformio
29+
run: |
30+
pip install platformio==5.0.3
31+
32+
- name: build firmware
33+
run: |
34+
export PLATFORMIO_BUILD_DIR=$HOME/build
35+
make ci
36+
mkdir firmware
37+
cp $PLATFORMIO_BUILD_DIR/pro16MHzatmega328/firmware.hex firmware/
38+
39+
- name: upload artifacts
40+
uses: actions/upload-artifact@master
41+
with:
42+
name: firmware
43+
path: firmware/
44+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
on:
2+
release:
3+
types: [created]
4+
5+
name: Upload release assets after release is created
6+
jobs:
7+
build:
8+
name: create assets
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
14+
- name: install platformio
15+
run: |
16+
pip install platformio==5.0.3
17+
18+
- name: build firmware
19+
run: |
20+
export PLATFORMIO_BUILD_DIR=$HOME/build
21+
make ci
22+
mkdir firmware
23+
cp $PLATFORMIO_BUILD_DIR/pro16MHzatmega328/firmware.hex firmware/
24+
25+
- name: Upload release assets
26+
uses: skx/github-action-publish-binaries@c881a3f8ffb80b684f367660178d38ceabc065c2
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
with:
30+
args: './firmware/*'

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Carl music box
22

3+
[![build firmware](https://github.com/jandelgado/carl/actions/workflows/build.yml/badge.svg)](https://github.com/jandelgado/carl/actions/workflows/build.yml)
4+
35
This is the firmware repository for the Carl music box. Details will follow
46
shortly.
57

0 commit comments

Comments
 (0)