Build and Publish Rust Binding #8
Workflow file for this run
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: 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] | |
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 | |
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: Install dependencies (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
git clone https://github.com/microsoft/vcpkg.git | |
.\vcpkg\bootstrap-vcpkg.bat | |
.\vcpkg\vcpkg install sqlite3:x64-windows | |
shell: cmd | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Change to imspy-connector directory | |
run: cd imspy_connector | |
- name: Build with Maturin | |
run: | | |
cd imspy_connector | |
maturin build --release | |
- name: Publish | |
if: matrix.publish | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.IMSPY_CONNECTOR_PYPI_API_TOKEN }} | |
run: | | |
cd imspy_connector | |
maturin publish --no-sdist |