Skip to content

Apply suggestions from code review #14

Apply suggestions from code review

Apply suggestions from code review #14

Workflow file for this run

# 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: Build Python Package
on:
release:
types: [created]
push: {}
jobs:
build:
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 for PyPi
run: |
poetry build --format wheel
- 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: Publish to PyPi
if: startsWith(github.ref, 'refs/tags/')
env:
PYPI_USERNAME: __token__
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry publish --username=$PYPI_USERNAME --password=$PYPI_PASSWORD
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
path: dist/*.whl
- name: Upload Release Assets
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
dist/*.whl