-
Notifications
You must be signed in to change notification settings - Fork 5
74 lines (65 loc) · 2.83 KB
/
firmware.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
69
70
71
72
73
74
# ------------------------------------------------------------------------------
# USB EPROM/Flash Programmer
#
# Copyright (2022) Robson Martins
#
# This work is licensed under a Creative Commons Attribution-NonCommercial-
# ShareAlike 4.0 International License.
# ------------------------------------------------------------------------------
name: Build Firmware
on:
workflow_dispatch:
schedule:
- cron: '4 2 * * *'
env:
BUILD_TYPE: Release
FIRMWARE_PROJECT_DIR: ${{github.workspace}}/firmware/usbflashprog
jobs:
build:
name: Build Firmware
runs-on: ubuntu-latest
steps:
# ------------------------------------------------------------------------
# Checkout the sources
# ------------------------------------------------------------------------
- name: Checkout the Sources
uses: actions/checkout@v3
# ------------------------------------------------------------------------
# Install Prerequisites
# ------------------------------------------------------------------------
- name: Install Prerequisites
run: |
sudo apt-get update
sudo apt-get install cmake build-essential gcc-arm-none-eabi libstdc++-arm-none-eabi-newlib automake autoconf texinfo libtool libftdi-dev libusb-1.0-0-dev
# ------------------------------------------------------------------------
# Install Pico SDK
# ------------------------------------------------------------------------
- name: Install Pico SDK
working-directory: ${{env.FIRMWARE_PROJECT_DIR}}
run: |
git clone -b master https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk
git submodule update --init
echo "PICO_SDK_PATH=${{env.FIRMWARE_PROJECT_DIR}}/pico-sdk" >> $GITHUB_ENV
# ------------------------------------------------------------------------
# Configure CMake
# ------------------------------------------------------------------------
- name: Configure CMake
working-directory: ${{env.FIRMWARE_PROJECT_DIR}}
run: cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DNORMAL_BUILD=ON
# ------------------------------------------------------------------------
# Build
# ------------------------------------------------------------------------
- name: Build
working-directory: ${{env.FIRMWARE_PROJECT_DIR}}
run: |
cmake --build build --config ${{env.BUILD_TYPE}}
mv "build/ufprog.uf2" "build/ufprog-`cat VERSION`-`date +%s`.uf2"
# ------------------------------------------------------------------------
# Upload the Binary
# ------------------------------------------------------------------------
- name: Upload the Firmware Binary (uf2)
uses: actions/upload-artifact@v3
with:
path: "${{env.FIRMWARE_PROJECT_DIR}}/build/ufprog-*.uf2"
name: "ufprog-uf2-firmware"