-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nils
authored and
nils
committed
Dec 9, 2023
1 parent
f53c39a
commit ea4d008
Showing
7 changed files
with
81 additions
and
1 deletion.
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,44 @@ | ||
name: Deploy new version | ||
|
||
# Only deploy when a new tag is pushed | ||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
# Must match the project() name in CMakeLists.txt | ||
env: | ||
APP_NAME: pico_trigger_uart | ||
|
||
# Allow this workflow to write back to the repository | ||
permissions: | ||
contents: write | ||
|
||
# Build binary and send to releases | ||
jobs: | ||
build-deploy: | ||
runs-on: ubuntu-latest | ||
name: Build and deploy | ||
steps: | ||
|
||
- name: Check out this repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build Docker image | ||
run: docker build -t pico-builder-image . | ||
|
||
- name: Create Docker container | ||
run: docker create --name pico-builder-container pico-builder-image | ||
|
||
- name: Copy out .uf2 file | ||
run: docker cp pico-builder-container:/project/src/build/${APP_NAME}.uf2 ./${APP_NAME}.uf2 | ||
|
||
- name: Put environment variable into the env context | ||
run: echo "app_name=$APP_NAME" >> $GITHUB_ENV | ||
|
||
- name: Push to release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: ${{ env.app_name }}.uf2 | ||
body_path: CHANGELOG.md |
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,3 @@ | ||
## 0.0.1 | ||
|
||
- First version |
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,33 @@ | ||
# Fetch ubuntu image | ||
FROM ubuntu:22.04 | ||
|
||
# Install prerequisites | ||
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 | ||
RUN \ | ||
mkdir -p /project/src/ && \ | ||
cd /project/ && \ | ||
git clone https://github.com/raspberrypi/pico-sdk.git --branch master && \ | ||
cd pico-sdk/ && \ | ||
git submodule update --init && \ | ||
cd / | ||
|
||
# Set the Pico SDK environment variable | ||
ENV PICO_SDK_PATH=/project/pico-sdk/ | ||
|
||
# Copy in our source files | ||
COPY src/* /project/src/ | ||
|
||
# Build project | ||
RUN \ | ||
mkdir -p /project/src/build && \ | ||
cd /project/src/build && \ | ||
cmake .. && \ | ||
make | ||
|
||
# Command that will be invoked when the container starts | ||
ENTRYPOINT ["/bin/bash"] |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.