Skip to content

v0.3.1-alpha-f1

v0.3.1-alpha-f1 #38

name: Build and Publish Rust Binding
on:
release:
types: [published]
permissions:
contents: read
jobs:
build-and-publish:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
python-version: ['3.11']
include:
- os: ubuntu-latest
python-version: '3.11'
publish: true
- os: windows-latest
python-version: '3.11'
publish: true
- os: macos-13
python-version: '3.11'
publish: true
- os: macos-14
python-version: '3.11'
publish: true
target: aarch64-apple-darwin
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Maturin
run: |
python -m pip install --upgrade pip
pip install maturin
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: ${{ matrix.target || '' }}
- name: Change to imspy-connector directory
run: cd imspy_connector
- name: Clean Cargo Artifacts
run: |
cd imspy_connector
cargo clean
- name: Build with Maturin
run: |
cd imspy_connector
if [ -n "${{ matrix.target }}" ]; then
maturin build --release --target ${{ matrix.target }}
else
maturin build --release
fi
- name: Publish
if: matrix.publish
env:
MATURIN_PYPI_TOKEN: ${{ secrets.IMSPY_CONNECTOR_PYPI_API_TOKEN }}
run: |
cd imspy_connector
maturin publish --no-sdist