Merge pull request #404 from quantumjot/fix-linting-error #651
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: Deploy | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build_wheels: | |
name: |- | |
Build wheels on ${{ matrix.os }} with | |
windows_cross_compile=${{ matrix.windows_cross_compile }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-11, ubuntu-20.04] | |
windows_cross_compile: [false, true] | |
exclude: | |
- os: macos-11 | |
windows_cross_compile: true | |
steps: | |
- name: Install dependencies | |
run: |- | |
sudo apt-get update | |
sudo apt-get install -y mingw-w64 | |
if: ${{ matrix.windows_cross_compile }} | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Build wheels | |
run: bash build.sh | |
env: | |
WINDOWS_CROSS_COMPILE: ${{ matrix.windows_cross_compile }} | |
- name: Upload artefacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artefacts | |
path: btrack/libs/* | |
if-no-files-found: error | |
deploy-to-testpypi: | |
needs: build_wheels | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Download artefacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: artefacts | |
path: btrack/libs | |
- name: Set up python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
cache: "pip" | |
cache-dependency-path: "pyproject.toml" | |
- name: Install dependencies | |
run: python -m pip install build | |
- name: Build distributions | |
run: python -m build | |
- name: Publish package to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.TESTPYPI_SECRET }} | |
repository-url: https://test.pypi.org/legacy/ | |
verify-testpypi-contains-binary: | |
needs: deploy-to-testpypi | |
name: ${{ matrix.os }} py${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
os: [ubuntu-latest] | |
include: | |
- os: macos-11 | |
python-version: "3.11" | |
- os: macos-latest | |
python-version: "3.11" | |
- os: windows-2019 | |
python-version: "3.11" | |
- os: windows-latest | |
python-version: "3.11" | |
- os: ubuntu-20.04 | |
python-version: "3.11" | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Set up python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip | |
- name: Install package from TestPyPI | |
run: >- | |
python -m pip install | |
-i https://test.pypi.org/simple/ | |
--extra-index-url https://pypi.org/simple | |
--upgrade btrack | |
- name: Create BayesianTracker instance | |
run: |- | |
import btrack | |
btrack.BayesianTracker() | |
shell: python | |
deploy-to-pypi: | |
needs: verify-testpypi-contains-binary | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Download artefacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: artefacts | |
path: btrack/libs | |
- name: Set up python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
cache: "pip" | |
cache-dependency-path: "pyproject.toml" | |
- name: Install dependencies | |
run: python -m pip install build | |
- name: Build distributions | |
run: python -m build | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_PASSWORD }} |