Skip to content

Commit

Permalink
Add nightly builds workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Pol Henarejos <[email protected]>
  • Loading branch information
polhenarejos committed Sep 30, 2024
1 parent f7451f5 commit 954eb1d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 4 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Nightly deploy"

on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:

jobs:
nightly:
name: Deploy nightly
strategy:
fail-fast: false
matrix:
refs: [main, development]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ matrix.refs }}
submodules: 'recursive'
- name : Build
env:
PICO_SDK_PATH: ../pico-sdk
run: |
./workflows/autobuild.sh pico
./build_pico_hsm.sh
- name: Update nightly release
uses: pyTooling/Actions/releaser@main
with:
tag: nightly-${{ matrix.refs }}
rm: true
token: ${{ secrets.GITHUB_TOKEN }}
files: release/*.*
13 changes: 9 additions & 4 deletions build_pico_hsm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

VERSION_MAJOR="4"
VERSION_MINOR="2"
SUFFIX="${VERSION_MAJOR}.${VERSION_MINOR}"
#if ! [[ -z "${GITHUB_SHA}" ]]; then
# SUFFIX="${SUFFIX}.${GITHUB_SHA}"
#fi

rm -rf release/*
mkdir -p build_release
mkdir -p release
cd build_release

for board in 0xcb_helios \
Expand Down Expand Up @@ -96,8 +102,7 @@ for board in 0xcb_helios \
wiznet_w5100s_evb_pico
do
rm -rf *
PICO_SDK_PATH=~/Devel/pico/pico-sdk cmake .. -DPICO_BOARD=$board
make -kj20
mv pico_hsm.uf2 ../release/pico_hsm_$board-$VERSION_MAJOR.$VERSION_MINOR.uf2

PICO_SDK_PATH="${PICO_SDK_PATH:-../../pico-sdk}" cmake .. -DPICO_BOARD=$board
make -j`nproc`
mv pico_hsm.uf2 ../release/pico_hsm_$board-$SUFFIX.uf2
done
9 changes: 9 additions & 0 deletions workflows/autobuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@ git clone https://github.com/raspberrypi/pico-sdk
cd pico-sdk
git submodule update --init
cd ..
git clone https://github.com/raspberrypi/picotool
cd picotool
git submodule update --init
mkdir build
cd build
cmake -DPICO_SDK_PATH=../../pico-sdk ..
make -j`nproc`
sudo make install
cd ../..
mkdir build_pico
cd build_pico
cmake -DPICO_SDK_PATH=../pico-sdk ..
make
elif [[ $1 == "esp32" ]]; then
Expand Down

0 comments on commit 954eb1d

Please sign in to comment.