8000 Merge pull request #10123 from Neradoc/fix-custom-build-action · FoamyGuy/circuitpython@64e87e2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 64e87e2

Browse files
authored
Merge pull request adafruit#10123 from Neradoc/fix-custom-build-action
Fix custom build workflow
2 parents ac184f0 + 266c6de commit 64e87e2

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

.github/workflows/build-board-custom.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,18 @@ jobs:
7373
uses: actions/setup-python@v5
7474
with:
7575
python-version: 3.x
76+
- name: Board to port
77+
id: board-to-port
78+
run: |
79+
PORT=$(python tools/board_to_port.py "${{ inputs.board }}")
80+
echo "port=$PORT" >> $GITHUB_OUTPUT
81+
shell: bash
7682
- name: Set up port
7783
id: set-up-port
7884
uses: ./.github/actions/deps/ports
7985
with:
8086
board: ${{ inputs.board }}
87+
port: ${{ steps.board-to-port.outputs.port }}
8188
- name: Set up submodules
8289
id: set-up-submodules
8390
uses: ./.github/actions/deps/submodules
@@ -88,7 +95,7 @@ jobs:
8895
uses: ./.github/actions/deps/external
8996
with:
9097
action: cache
91-
port: ${{ steps.set-up-port.outputs.port }}
98+
port: ${{ steps.board-to-port.outputs.port }}
9299
- name: Set up mpy-cross
93100
if: steps.set-up-submodules.outputs.frozen == 'True'
94101
uses: ./.github/actions/mpy_cross
@@ -115,9 +122,9 @@ jobs:
115122
FLAGS: ${{ inputs.flags }}
116123
DEBUG: ${{ inputs.debug && '1' || '0' }}
117124
run: make -j4 $FLAGS BOARD="$BOARD" DEBUG=$DEBUG TRANSLATION="$TRANSLATION"
118-
working-directory: ports/${{ steps.set-up-port.outputs.port }}
125+
working-directory: ports/${{ steps.board-to-port.outputs.port }}
119126
- name: Upload artifact
120127
uses: actions/upload-artifact@v4
121128
with:
122129
name: ${{ inputs.board }}-${{ inputs.language }}-${{ inputs.version }}${{ inputs.flags != '' && '-custom' || '' }}${{ inputs.debug && '-debug' || '' }}
123-
path: ports/${{ steps.set-up-port.outputs.port }}/build-${{ inputs.board }}/firmware.*
130+
path: ports/${{ steps.board-to-port.outputs.port }}/build-${{ inputs.board }}/firmware.*

tools/board_to_port.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python3
2+
3+
# SPDX-FileCopyrightText: 2025 CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
4+
#
5+
# SPDX-License-Identifier: MIT
6+
7+
import sys
8+
from pathlib import Path
9+
10+
docs = Path(__file__).parent.parent / "docs"
11+
sys.path.append(str(docs))
12+
from shared_bindings_matrix import get_board_mapping
13+
14+
board = sys.argv[1]
15+
16+
board_mapping = get_board_mapping()
17+
if board in board_mapping:
18+
board_info = board_mapping[board]
19+
print(board_info["port"])
20+
sys.exit(0)
21+
22+
raise ValueError(f"No port directory associated with the board tag given {board}.")

0 commit comments

Comments
 (0)
0