|
| 1 | +# |
| 2 | +# ISC License |
| 3 | +# |
| 4 | +# Copyright (c) 2026, Autonomous Vehicle Systems Lab, University of Colorado at Boulder |
| 5 | +# |
| 6 | +# Permission to use, copy, modify, and/or distribute this software for any |
| 7 | +# purpose with or without fee is hereby granted, provided that the above |
| 8 | +# copyright notice and this permission notice appear in all copies. |
| 9 | +# |
| 10 | +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 11 | +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 12 | +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 13 | +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 14 | +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 15 | +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 16 | +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 17 | +# |
| 18 | + |
| 19 | +name: Build bsk-sdk distributions |
| 20 | +description: > |
| 21 | + Checks out the matching Basilisk submodule, syncs vendored artifacts, |
| 22 | + and builds the bsk-sdk wheel. |
| 23 | +
|
| 24 | +inputs: |
| 25 | + sdist: |
| 26 | + description: Build an sdist alongside the wheel |
| 27 | + default: "false" |
| 28 | + output-dir: |
| 29 | + description: Directory to write built distributions into |
| 30 | + default: dist |
| 31 | + |
| 32 | +runs: |
| 33 | + using: composite |
| 34 | + steps: |
| 35 | + - name: Determine BSK release tag |
| 36 | + id: bsk-tag |
| 37 | + shell: bash |
| 38 | + run: | |
| 39 | + BSK_TAG=$(python -c " |
| 40 | + import re |
| 41 | + from pathlib import Path |
| 42 | + text = Path('pyproject.toml').read_text() |
| 43 | + match = re.search(r'(?m)^version\s*=\s*\"([^\"]+)\"', text) |
| 44 | + if not match: |
| 45 | + raise SystemExit('version not found in pyproject.toml') |
| 46 | + print('v' + match.group(1)) |
| 47 | + ") |
| 48 | + echo "tag=$BSK_TAG" >> $GITHUB_OUTPUT |
| 49 | +
|
| 50 | + - name: Checkout Basilisk submodule at release tag |
| 51 | + shell: bash |
| 52 | + run: | |
| 53 | + git submodule update --init --depth 1 external/basilisk |
| 54 | + git -C external/basilisk fetch origin \ |
| 55 | + refs/tags/${{ steps.bsk-tag.outputs.tag }}:refs/tags/${{ steps.bsk-tag.outputs.tag }} \ |
| 56 | + --depth 1 |
| 57 | + git -C external/basilisk checkout ${{ steps.bsk-tag.outputs.tag }} |
| 58 | +
|
| 59 | + - name: Sync Basilisk artifacts |
| 60 | + shell: bash |
| 61 | + run: python tools/sync_all.py |
| 62 | + |
| 63 | + - name: Install build tooling |
| 64 | + shell: bash |
| 65 | + run: python -m pip install --upgrade pip build |
| 66 | + |
| 67 | + - name: Build distributions |
| 68 | + shell: bash |
| 69 | + env: |
| 70 | + BSK_SDK_AUTO_SYNC: "0" |
| 71 | + run: | |
| 72 | + if [ "${{ inputs.sdist }}" = "true" ]; then |
| 73 | + python -m build --outdir "${{ inputs.output-dir }}" |
| 74 | + else |
| 75 | + python -m build --wheel --outdir "${{ inputs.output-dir }}" |
| 76 | + fi |
0 commit comments