|
1 | | -# circuitpython |
| 1 | +# action-circuitpython-builder |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +`action-circuitpython-builder` is a GitHub Action designed to build CircuitPython ports. It supports multiple platforms and targets, enabling developers to quickly build and release CircuitPython projects. |
| 6 | + |
| 7 | +## Features |
| 8 | + |
| 9 | +- Supports multiple CircuitPython platforms (e.g., espressif, nordic). |
| 10 | +- Supports build and release targets. |
| 11 | +- Allows specifying single or multiple boards for building. |
| 12 | + |
| 13 | +## Usage |
| 14 | + |
| 15 | +### 1. Reference in Workflow |
| 16 | + |
| 17 | +Add the following to your GitHub Actions workflow file: |
| 18 | + |
| 19 | +```yaml |
| 20 | +yaml |
| 21 | +jobs: |
| 22 | + build: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + |
| 25 | + steps: |
| 26 | + - name: Checkout repository |
| 27 | + uses: actions/checkout@v3 |
| 28 | + |
| 29 | + - name: Build CircuitPython |
| 30 | + uses: fobe-projects/action-circuitpython-builder@v1 |
| 31 | + with: |
| 32 | + cpy_platform: "espressif" # Required, specify the platform |
| 33 | + cpy_target: "build" # Optional, defaults to build |
| 34 | + cpy_board: "esp32" # Required when cpy_target is build |
| 35 | +``` |
| 36 | +
|
| 37 | +### 2. Input Parameters |
| 38 | +
|
| 39 | +| Parameter Name | Required | Default | Description | |
| 40 | +|-----------------|----------|----------|-----------------------------------------------| |
| 41 | +| `cpy_platform` | Yes | None | CircuitPython platform (e.g., espressif, nordic). | |
| 42 | +| `cpy_target` | No | `build` | Target to run, options are `build` or `release`. | |
| 43 | +| `cpy_board` | No | None | Required when `cpy_target` is `build`, specify the board. | |
| 44 | +| `cpy_boards` | No | None | Required when `cpy_target` is `release`, specify multiple boards. | |
| 45 | + |
| 46 | +### 3. Examples |
| 47 | + |
| 48 | +#### Build a Single Board |
| 49 | + |
| 50 | +```yaml |
| 51 | +yaml |
| 52 | +jobs: |
| 53 | + build: |
| 54 | + runs-on: ubuntu-latest |
| 55 | +
|
| 56 | + steps: |
| 57 | + - name: Checkout repository |
| 58 | + uses: actions/checkout@v3 |
| 59 | +
|
| 60 | + - name: Build CircuitPython for ESP32 |
| 61 | + uses: fobe-projects/action-circuitpython-builder@v1 |
| 62 | + with: |
| 63 | + cpy_platform: "espressif" |
| 64 | + cpy_target: "build" |
| 65 | + cpy_board: "esp32" |
| 66 | +``` |
| 67 | + |
| 68 | +#### Release Multiple Boards |
| 69 | + |
| 70 | +```yaml |
| 71 | +yaml |
| 72 | +jobs: |
| 73 | + release: |
| 74 | + runs-on: ubuntu-latest |
| 75 | +
|
| 76 | + steps: |
| 77 | + - name: Checkout repository |
| 78 | + uses: actions/checkout@v3 |
| 79 | +
|
| 80 | + - name: Release CircuitPython for multiple boards |
| 81 | + uses: fobe-projects/action-circuitpython-builder@v1 |
| 82 | + with: |
| 83 | + cpy_platform: "nordic" |
| 84 | + cpy_target: "release" |
| 85 | + cpy_boards: "board1,board2,board3" |
| 86 | +``` |
| 87 | + |
| 88 | +## Notes |
| 89 | + |
| 90 | +- When `cpy_target` is `build`, the `cpy_board` parameter must be provided. |
| 91 | +- When `cpy_target` is `release`, the `cpy_boards` parameter must be provided. |
| 92 | + |
| 93 | +## License |
| 94 | + |
| 95 | +This project is licensed under the MIT License. For details, see [LICENSE](./LICENSE). |
0 commit comments