-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use docker to build locally and in CI (#26)
This adds docker configuration files so that PrawnBlaster firmware can be built within a docker container on personal devices and in GitHub actions. ## Changes - Updates the pico-sdk to v1.5.1 - Remove uf2 files from the repository - Add docker file to build a container designed to build rp2040 firmware using the pico-sdk - Pin pico-sdk version via the docker file - Update license to 3-clause BSD license (from 2-clause BSD license) and add missing license file to the repository - Added GitHub action script that builds artefacts (containing the uf2 files) for pull requests and releases when commits are tagged.
- Loading branch information
1 parent
3896b1a
commit a2fb893
Showing
9 changed files
with
130 additions
and
6 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,39 @@ | ||
name: Build firmware | ||
|
||
on: | ||
create: | ||
tags: | ||
- '[0-9]+\.[0-9]+\.[0-9]+*' | ||
pull_request: | ||
types: [opened, reopened, synchronize, ready_for_review] | ||
|
||
jobs: | ||
build-firmware: | ||
runs-on: ubuntu-latest | ||
name: Build firmware | ||
steps: | ||
- name: Check out this repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build Docker image | ||
run: docker compose build --pull --build-arg APT_MIRROR="http://azure.archive.ubuntu.com/ubuntu/" | ||
|
||
- name: Run docker container | ||
run: docker compose up | ||
|
||
- name: Upload firmware as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: prawnblaster-firmware-${{ github.sha }} | ||
path: build/prawnblaster/*.uf2 | ||
|
||
- name: Create release | ||
if: ${{ github.event.ref_type == 'tag' }} | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
prerelease: false | ||
files: | | ||
LICENSE.txt | ||
build/prawnblaster/prawnblaster.uf2 | ||
build/prawnblaster/prawnblasteroverclock.uf2 |
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,25 @@ | ||
Copyright 2021, Philip Starkey | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are | ||
permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this list of | ||
conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, this list | ||
of conditions and the following disclaimer in the documentation and/or other materials | ||
provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors may be | ||
used to endorse or promote products derived from this software without specific prior | ||
written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY | ||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL | ||
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT | ||
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Binary file not shown.
Binary file not shown.
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,11 @@ | ||
name: prawnblaster | ||
|
||
services: | ||
buildfirmware: | ||
build: | ||
dockerfile: docker/Dockerfile | ||
command: /bin/bash -c 'cmake .. && make' | ||
volumes: | ||
- .:/prawnblaster | ||
working_dir: /prawnblaster/build | ||
init: true |
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,29 @@ | ||
# Fetch ubuntu image | ||
FROM ubuntu:latest AS base | ||
# Attempt to auto-detect the best mirror (desn't always work well though) | ||
ARG APT_MIRROR="mirror://mirrors.ubuntu.com/mirrors.txt" | ||
# Use this one if you are in Australia | ||
# ARG APT_MIRROR="http://mirror.aarnet.edu.au/pub/ubuntu/archive/" | ||
|
||
# Configure mirror. Pass --build-arg APT_MIRROR=<mirror URL> to set a mirror if this is slow | ||
RUN sed -i "s#htt[p|ps]://archive.ubuntu.com/ubuntu/#$APT_MIRROR#g" /etc/apt/sources.list | ||
|
||
# Install packages | ||
RUN \ | ||
apt update && \ | ||
apt install -y git python3 && \ | ||
apt install -y cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential | ||
|
||
# Install Pico SDK into a new stage | ||
FROM base as buildtools | ||
|
||
RUN \ | ||
mkdir -p /pico/ && \ | ||
cd /pico/ && \ | ||
git clone https://github.com/raspberrypi/pico-sdk.git --branch 1.5.1 && \ | ||
cd pico-sdk/ && \ | ||
git submodule update --init && \ | ||
cd / | ||
|
||
# Set the Pico SDK environment variable | ||
ENV PICO_SDK_PATH=/pico/pico-sdk/ |
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
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