forked from aappleby/picorvd
-
Notifications
You must be signed in to change notification settings - Fork 2
122 lines (104 loc) · 4.26 KB
/
build.yml
File metadata and controls
122 lines (104 loc) · 4.26 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Build Firmware
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-15]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout PicoRVD
uses: actions/checkout@v6
with:
path: PicoRVD
- name: Checkout pico-sdk/2.2.0
uses: actions/checkout@v6
with:
repository: raspberrypi/pico-sdk
ref: 2.2.0
path: pico-sdk
- name: Checkout pico-sdk submodules
working-directory: ${{github.workspace}}/pico-sdk
run: git submodule update --init
- name: Install dependencies (Windows)
if: ${{ matrix.os == 'windows-latest' }}
working-directory: ${{github.workspace}}/PicoRVD
run: choco install .github/workflows/choco_packages.config
- name: Download and setup libusb
if: ${{ matrix.os == 'windows-latest' }}
shell: bash
run: |
echo "Downloading libusb..."
curl -L https://github.com/libusb/libusb/releases/download/v1.0.29/libusb-1.0.29.7z -o libusb.7z
echo "Extracting libusb..."
7z x libusb.7z -oC:/libusb -y
echo "Checking libusb structure..."
ls -la C:/libusb/
ls -la C:/libusb/MinGW64/static/ || true
ls -la C:/libusb/MinGW64/dll/ || true
echo "Cloning picotool..."
git clone https://github.com/raspberrypi/picotool.git --branch 2.2.0 --depth 1 C:/picotool-src
echo "Building picotool with libusb support..."
mkdir -p C:/picotool-src/build
cd C:/picotool-src/build
# Use the correct x86_64 MinGW64 paths (not ARM64!)
cmake -G "Ninja" \
-DCMAKE_BUILD_TYPE=Release \
-DPICO_SDK_PATH="${{github.workspace}}/pico-sdk" \
-DLIBUSB_LIBRARIES="C:/libusb/MinGW64/static/libusb-1.0.dll.a" \
-DLIBUSB_INCLUDE_DIR="C:/libusb/include" \
..
# Build
ninja
# Verify picotool was built
if [ ! -f "picotool.exe" ]; then
echo "ERROR: picotool.exe was not built!"
exit 1
fi
# Create deployment directory
mkdir -p C:/picotool-bin
# Copy picotool executable and required DLL (x86_64 version!)
cp picotool.exe C:/picotool-bin/
cp C:/libusb/MinGW64/dll/libusb-1.0.dll C:/picotool-bin/
# Add to PATH for subsequent steps
echo "C:/picotool-bin" >> $GITHUB_PATH
echo "Testing binary"
./picotool.exe --version || true
- name: Install dependencies (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get update && sudo apt-get install -y build-essential git cmake gcc-arm-none-eabi gcc-riscv64-unknown-elf
- name: Install dependencies (Mac)
if: ${{ matrix.os == 'macos-15' }}
run: |
brew install make
brew install gcc-arm-embedded
brew tap riscv-software-src/riscv
brew install riscv-tools
- name: Build Project (CH32V003 Blinky)
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-15' }}
working-directory: ${{github.workspace}}/PicoRVD
shell: bash
run: |
cd example
./build.sh
- name: Build Project (PicoRVD)
working-directory: ${{github.workspace}}/PicoRVD
# bash required otherwise this mysteriously (no error) fails at "Generating cyw43_bus_pio_spi.pio.h"
shell: bash
run: |
mkdir bin
INCLUDE_BIN=ON
PICOTOOL_OPTION=
if [ "$RUNNER_OS" == "Windows" ]; then
INCLUDE_BIN=OFF
PICOTOOL_OPTION=-DPICOTOOL_FETCH_FROM_GIT_PATH=C:/picotool-bin/
fi
cmake -B bin -G "Unix Makefiles" -DPICO_SDK_PATH=../pico-sdk -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON $PICOTOOL_OPTION -DINCLUDE_BLINKY_BINARY:BOOL=$INCLUDE_BIN -DCMAKE_BUILD_TYPE=Release -DPICO_BOARD=pico
make -j8 -C bin
- name: Upload UF2 File
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v6
with:
name: PicoRVD.uf2
path: ${{github.workspace}}/PicoRVD/bin/picorvd.uf2