Publish PPLib Python Release #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish PPLib Python Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: string | |
description: The full version string, i.e. 2024.0.0-alpha-1 or 2024.1.1 | |
required: true | |
jobs: | |
build: | |
name: "Build & Publish to PyPI" | |
runs-on: ubuntu-22.04 | |
environment: | |
name: pypi | |
url: https://pypi.org/project/robotpy-pathplannerlib/ | |
permissions: | |
id-token: write | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
working-directory: ./pathplannerlib-python | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Set version | |
run: sed -i "s/0.0.0/${{ github.event.inputs.version }}/g" pyproject.toml | |
working-directory: ./pathplannerlib-python | |
- name: Build | |
working-directory: ./pathplannerlib-python | |
run: python -m build | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: pathplannerlib-python/dist/ |