Publish #2562
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: Publish | |
on: | |
workflow_run: | |
workflows: ["CI"] | |
branches: [master] | |
types: | |
- completed | |
jobs: | |
publish: | |
if: >- | |
github.event.workflow_run.conclusion == 'success' && | |
github.event.workflow_run.head_branch == 'master' && | |
github.event.workflow_run.event == 'push' && | |
github.repository == 'rwth-i6/returnn' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout submodules | |
run: | | |
git submodule sync | |
git submodule update --init --recursive | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.7 | |
- name: Install Python deps | |
run: | | |
echo "PATH=$PATH:$HOME/.local/bin" >> $GITHUB_ENV | |
pip3 install --user --upgrade pip setuptools wheel twine | |
pip3 install --user typing # needed for Python 2 in some cases | |
pip3 install --user -r requirements.txt | |
- run: python3 setup.py sdist | |
# https://github.com/marketplace/actions/pypi-publish | |
- name: Publish to PyPI | |
# https://github.com/pypa/gh-action-pypi-publish/issues/112 | |
uses: pypa/gh-action-pypi-publish@release/v1.4 | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_password }} |