Skip to content

v3.1.176

v3.1.176 #140

Workflow file for this run

name: Publish Python Packages To Pypi
permissions:
contents: read
on:
workflow_dispatch:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build hatchling
- name: Build packages
run: |
for each in $(find "${GITHUB_WORKSPACE}" -maxdepth 1 -mindepth 1 -type d -name "*sdk*")
do
cd "${each}" || exit 1
if [ -f "pyproject.toml" ]; then
python -m build --wheel --no-isolation
cp dist/*.whl "${GITHUB_WORKSPACE}"
else
echo "::warning::pyproject.toml not found for ${each}, skip build"
fi
done
shell: bash
- name: Publish packages
run: |
echo -e "[pypi]\nusername = __token__\npassword = ${PYPI_API_TOKEN}" >> "${HOME}/.pypirc"
cd "${GITHUB_WORKSPACE}" || exit 1
twine upload --repository pypi ./*.whl --skip-existing --verbose
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}