Skip to content

Commit c3d67f8

Browse files
committed
add the CI config file
1 parent efb1be8 commit c3d67f8

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: build
2+
on: [push]
3+
jobs:
4+
build_fw:
5+
name: Build the firmware for STM32
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Install Packages
9+
run: |
10+
sudo apt update
11+
sudo apt install cmake libc6-i386
12+
wget https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q3-update/+download/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2
13+
sudo tar -xf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 -C /opt
14+
15+
- uses: actions/checkout@v2
16+
with:
17+
submodules: recursive
18+
19+
- name: Build the firmware
20+
run: |
21+
mkdir build && pushd build
22+
touch git_hash.c
23+
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake -DCROSS_COMPILE=/opt/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi- -DCMAKE_BUILD_TYPE=Release -DENABLE_DEBUG_OUTPUT=OFF ..
24+
make -j2 canokey.bin
25+
popd
26+
27+
- name: Create a Release
28+
id: create_release
29+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
30+
uses: actions/create-release@v1
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
with:
34+
tag_name: ${{ github.ref }}
35+
release_name: Release ${{ github.ref }}
36+
draft: false
37+
prerelease: false
38+
39+
- name: Upload Release Assets
40+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
41+
uses: actions/upload-release-asset@v1
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
with:
45+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
46+
asset_path: build/canokey.bin
47+
asset_name: canokey.bin
48+
asset_content_type: application/octet-stream
49+

0 commit comments

Comments
 (0)