Updated Docs #90
This file contains hidden or 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: Publish Python Package | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'locallab/**' | |
- 'client/python_client/**' | |
- 'setup.py' | |
- 'client/python_client/setup.py' | |
- '.github/workflows/publish.yml' | |
- 'CHANGELOG.md' | |
permissions: | |
contents: write | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- package: 'locallab' | |
path: '.' # Root directory for locallab package | |
- package: 'python-client' | |
path: 'client/python_client' # Python client directory | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Install build dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build twine | |
- name: Build package | |
run: | | |
cd ${{ matrix.path }} | |
python -m build --sdist --wheel | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@v1.4.2 | |
with: | |
packages_dir: ${{ matrix.path }}/dist/ | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
skip_existing: true | |
- name: Create Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ matrix.package }}-v${{ github.run_number }} | |
release_name: ${{ matrix.package }} Release v${{ github.run_number }} | |
body: | | |
${{ matrix.package }} Release v${{ github.run_number }} | |
Changes in this release: | |
- See CHANGELOG.md for details | |
draft: false | |
prerelease: false |