Skip to content

Publish Python and Rust Packages #18

Publish Python and Rust Packages

Publish Python and Rust Packages #18

Workflow file for this run

name: Publish Python Package
on:
release:
types: [created]
workflow_dispatch:
permissions:
contents: read
id-token: write
concurrency:
group: "publish"
cancel-in-progress: true
jobs:
publish-python:
timeout-minutes: 10
name: Build and publish
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libudev-dev pkg-config
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel
- name: Build package
run: python -m build --sdist --outdir dist/ .
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
publish-rust:
timeout-minutes: 10
name: Build and publish
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Cache Cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry
restore-keys: |
${{ runner.os }}-cargo-registry
- name: Cache Cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index
restore-keys: |
${{ runner.os }}-cargo-index
- name: Publish Robstride package to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cd actuator/robstride
cargo publish