-
-
Notifications
You must be signed in to change notification settings - Fork 19
208 lines (200 loc) · 8.01 KB
/
build.yml
File metadata and controls
208 lines (200 loc) · 8.01 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: Build Firmware
on:
pull_request:
branches: [main]
push:
branches: [main]
tags:
- "v*"
- "*.*.*"
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout project
uses: actions/checkout@v4.2.2
- name: Install sox
run: |
sudo apt update
sudo apt install sox libsox-fmt-mp3
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3.0.0
with:
hugo-version: "0.135.0"
- name: Set up Python
uses: actions/setup-python@v5.6.0
with:
python-version: "3.11"
- name: Set up Zig
uses: goto-bus-stop/setup-zig@v2.2.1
with:
version: "0.11.0"
- name: Setup Go
uses: actions/setup-go@v5.5.0
- name: Install Pico SDK dependencies
run: |
sudo apt update
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential gcc wget tar
- name: Create and activate a Python virtual environment
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv .venv
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
echo "$PWD/.venv/bin" >> $GITHUB_PATH
- name: Install Python dependencies
run: uv pip install -r requirements.txt
- run: uv pip freeze
- name: Checkout pico-sdk
uses: actions/checkout@v4.2.2
with:
repository: raspberrypi/pico-sdk
path: pico-sdk
submodules: true
ref: 2.2.0
- name: Checkout pico-extras
uses: actions/checkout@v4.2.2
with:
repository: raspberrypi/pico-extras
path: pico-extras
submodules: true
ref: sdk-2.2.0
- name: Patch tinyusb
run: |
sed -i 's/OSAL_TIMEOUT_WAIT_FOREVER/OSAL_TIMEOUT_NORMAL/g' $GITHUB_WORKSPACE/pico-sdk/lib/tinyusb/src/tusb.c
cat $GITHUB_WORKSPACE/pico-sdk/lib/tinyusb/src/tusb.c | grep osal_mutex
- name: Set PICO_SDK_PATH
run: echo "PICO_SDK_PATH=$GITHUB_WORKSPACE/pico-sdk" >> $GITHUB_ENV
- name: Build zeptocore.uf2
run: |
make zeptocore
cp zeptocore.uf2 zeptocore_${{ github.ref_name }}.uf2
- name: Build zeptocore_128.uf2
run: |
make zeptocore_128
cp zeptocore.uf2 zeptocore_${{ github.ref_name }}_ultralow_latency.uf2
- name: Build zeptocore_256.uf2
run: |
make zeptocore_256
cp zeptocore.uf2 zeptocore_${{ github.ref_name }}_low_latency.uf2
- name: Build ezeptocore.uf2
run: |
make ezeptocore
cp ezeptocore.uf2 ezeptocore_${{ github.ref_name }}.uf2
- name: Build ezeptocore_128.uf2
run: |
make ezeptocore_128
cp ezeptocore.uf2 ezeptocore_${{ github.ref_name }}_ultralow_latency.uf2
- name: Build ezeptocore_256.uf2
run: |
make ezeptocore_256
cp ezeptocore.uf2 ezeptocore_${{ github.ref_name }}_low_latency.uf2
- name: Build ezeptocore no overclock
run: |
make ezeptocore_noclock
cp ezeptocore.uf2 ezeptocore_${{ github.ref_name }}_no_overclocking.uf2
- name: Build ezeptocore no overclock 128
run: |
make ezeptocore_noclock_128
cp ezeptocore.uf2 ezeptocore_${{ github.ref_name }}_no_overclocking_ultralow_latency.uf2
- name: Build ezeptocore no overclock 256
run: |
make ezeptocore_noclock_256
cp ezeptocore.uf2 ezeptocore_${{ github.ref_name }}_no_overclocking_low_latency.uf2
- name: Build ectocore.uf2
run: |
make ectocore
cp ectocore.uf2 ectocore_${{ github.ref_name }}.uf2
- name: Build ectocore_128.uf2
run: |
make ectocore_128
cp ectocore.uf2 ectocore_${{ github.ref_name }}_ultralow_latency.uf2
- name: Build ectocore_256.uf2
run: |
make ectocore_256
cp ectocore.uf2 ectocore_${{ github.ref_name }}_low_latency.uf2
- name: Build ectocore no overclock
run: |
make ectocore_noclock
cp ectocore.uf2 ectocore_${{ github.ref_name }}_no_overclocking.uf2
- name: Build ectocore no overclock 128
run: |
make ectocore_noclock_128
cp ectocore.uf2 ectocore_${{ github.ref_name }}_no_overclocking_ultralow_latency.uf2
- name: Build ectocore no overclock 256
run: |
make ectocore_noclock_256
cp ectocore.uf2 ectocore_${{ github.ref_name }}_no_overclocking_low_latency.uf2
- name: Build zeptoboard.uf2
run: |
make zeptoboard
cp zeptoboard.uf2 zeptoboard_${{ github.ref_name }}.uf2
- name: Prepare source tarball (on tags only)
if: startsWith(github.ref, 'refs/tags/')
run: |
git clone -b ${{ github.ref_name }} --depth 1 https://github.com/schollz/_core _core-${{ github.ref_name }}
cd _core-${{ github.ref_name }}/core && go mod tidy && go mod vendor
cd ../.. && tar -czvf _core_${{ github.ref_name }}_src.tar.gz _core-${{ github.ref_name }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: firmware-builds
path: |
zeptocore_${{ github.ref_name }}.uf2
zeptocore_${{ github.ref_name }}_ultralow_latency.uf2
zeptocore_${{ github.ref_name }}_low_latency.uf2
zeptoboard_${{ github.ref_name }}.uf2
ezeptocore_${{ github.ref_name }}.uf2
ezeptocore_${{ github.ref_name }}_ultralow_latency.uf2
ezeptocore_${{ github.ref_name }}_low_latency.uf2
ezeptocore_${{ github.ref_name }}_no_overclocking.uf2
ezeptocore_${{ github.ref_name }}_no_overclocking_ultralow_latency.uf2
ezeptocore_${{ github.ref_name }}_no_overclocking_low_latency.uf2
ectocore_${{ github.ref_name }}.uf2
ectocore_${{ github.ref_name }}_ultralow_latency.uf2
ectocore_${{ github.ref_name }}_low_latency.uf2
ectocore_${{ github.ref_name }}_no_overclocking.uf2
ectocore_${{ github.ref_name }}_no_overclocking_ultralow_latency.uf2
ectocore_${{ github.ref_name }}_no_overclocking_low_latency.uf2
_core_${{ github.ref_name }}_src.tar.gz
if-no-files-found: ignore
release:
name: Create GitHub Release (on tags)
runs-on: ubuntu-latest
needs: [build]
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: firmware-builds
path: ./dist
- name: List artifacts
run: ls -l ./dist
- name: Create Release and upload assets
uses: softprops/action-gh-release@v2
with:
files: |
dist/_core_${{ github.ref_name }}_src.tar.gz
dist/zeptocore_${{ github.ref_name }}.uf2
dist/zeptocore_${{ github.ref_name }}_ultralow_latency.uf2
dist/zeptocore_${{ github.ref_name }}_low_latency.uf2
dist/zeptoboard_${{ github.ref_name }}.uf2
dist/ezeptocore_${{ github.ref_name }}.uf2
dist/ezeptocore_${{ github.ref_name }}_ultralow_latency.uf2
dist/ezeptocore_${{ github.ref_name }}_low_latency.uf2
dist/ezeptocore_${{ github.ref_name }}_no_overclocking.uf2
dist/ezeptocore_${{ github.ref_name }}_no_overclocking_ultralow_latency.uf2
dist/ezeptocore_${{ github.ref_name }}_no_overclocking_low_latency.uf2
dist/ectocore_${{ github.ref_name }}.uf2
dist/ectocore_${{ github.ref_name }}_ultralow_latency.uf2
dist/ectocore_${{ github.ref_name }}_low_latency.uf2
dist/ectocore_${{ github.ref_name }}_no_overclocking.uf2
dist/ectocore_${{ github.ref_name }}_no_overclocking_ultralow_latency.uf2
dist/ectocore_${{ github.ref_name }}_no_overclocking_low_latency.uf2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}