Chore: update submodule (#74) #79
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 upload to PyPI | |
on: | |
push: | |
tags: | |
- '*' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-publish: | |
name: Build and publish Python distribution to PyPI | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Install pypa/build | |
run: >- | |
python3 -m | |
pip install | |
build | |
--user | |
- name: Build a binary wheel and a source tarball | |
run: >- | |
python3 -m | |
build | |
--sdist | |
--wheel | |
--outdir dist/ | |
. | |
# if is xorbitsai repo, upload to pypi | |
- uses: pypa/[email protected] | |
if: github.repository == 'xorbitsai/inference-client' | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_PASSWORD }} | |
# if is not xorbitsai repo, upload to test | |
- uses: pypa/[email protected] | |
if: github.repository != 'xorbitsai/inference-client' | |
with: | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_PASSWORD }} | |
verbose: true | |
repository_url: https://test.pypi.org/legacy/ | |
- name: Wait for PyPI | |
run: | | |
sleep 60s | |
test_import: | |
needs: [ build-publish ] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ "ubuntu-latest", "macos-12", "windows-latest" ] | |
python-version: [ "3.8", "3.9", "3.10", "3.11" ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install xinference-client | |
run: | | |
pip install -U xinference-client | |
working-directory: . | |
- name: Test import | |
run: | | |
python -c "from xinference_client import RESTfulClient as Client" | |
working-directory: . |