Skip to content

Upload Python Package #111

Upload Python Package

Upload Python Package #111

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Upload Python Package
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8.x'
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install Poetry plugins
run: |
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Build and publish
env:
PYPI_USERNAME: __token__
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry build --format wheel
poetry publish --username=$PYPI_USERNAME --password=$PYPI_PASSWORD
- name: Build for Sber
run: |
sed -i "s/smart-app-framework/sber-nlp-platform-smart-app-framework/g" pyproject.toml
poetry build --format wheel
- name: Upload Assets
uses: softprops/action-gh-release@v1
with:
files: |
dist/*.whl