Debian Codegraph @

.github/workflows/pypi.yml

raw
1 name: Publish to PyPI
2 on:
3 workflow_dispatch:
4 push:
5 tags:
6 - '*'
7
8 jobs:
9 build-n-publish:
10 name: Build and publish to PyPI and TestPyPI
11 runs-on: ubuntu-20.04
12 steps:
13 - uses: actions/checkout@main
14 - name: Set up Python 3.10
15 uses: actions/setup-python@v2
16 with:
17 python-version: '3.10'
18
19 - name: Install package
20 run: |
21 pip install build poetry
22
23 - name: Build source tarball
24 run: |
25 rm -rf dist;
26 poetry build
27
28 - name: Publish distribution to Test PyPI
29 uses: pypa/gh-action-pypi-publish@release/v1
30 with:
31 user: __token__
32 password: ${{ secrets.TEST_PYPI_API_TOKEN }}
33 repository_url: https://test.pypi.org/legacy/
34 - name: Publish distribution to PyPI
35 if: startsWith(github.ref, 'refs/tags')
36 uses: pypa/gh-action-pypi-publish@release/v1
37 with:
38 user: __token__
39 password: ${{ secrets.PYPI_API_TOKEN }}