Upload Python Package #25
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: Upload Python Package | |
on: | |
# Trigger the workflow only manually. | |
workflow_dispatch: | |
defaults: | |
run: | |
working-directory: emanifest-py | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Repo | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
cache: 'pip' | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install build twine | |
- name: Build package | |
run: python -m build | |
- name: Publish to PyPI | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
# use twine's "-r testpypi" flag to upload to http://test.pypi.org | |
run: | | |
pip install --upgrade twine | |
twine upload --skip-existing dist/* |