blob: 61eb5ff6f436876f585edcc549d6d4dc070e43f3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
name: Release
on:
release:
types:
- published
env:
DEFAULT_PYTHON: "3.10"
permissions:
contents: read
jobs:
release-pypi:
name: Upload release to PyPI
runs-on: ubuntu-latest
steps:
- name: Check out code from Github
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.3.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Install requirements
run: |
# Remove dist, build, and astroid.egg-info
# when building locally for testing!
python -m pip install twine build
- name: Build distributions
run: |
python -m build
- name: Upload to PyPI
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
env:
TWINE_REPOSITORY: pypi
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload --verbose dist/*
|