-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (42 loc) · 1.18 KB
/
release.yaml
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
42
43
44
45
name: Release
on:
release:
types:
- published
env:
DEFAULT_PYTHON: 3.12
jobs:
release-pypi:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: PyPI
url: https://pypi.org/project/python-typing-update/
permissions:
contents: write # Required to upload release assets
steps:
- name: Check out code from Github
uses: actions/checkout@v4.2.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.3.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Build distributions
run: |
python -m pip install -U pip twine build
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/*
- name: Upload release assets
uses: softprops/action-gh-release@v2.2.1
with:
files: |
dist/*.whl
dist/*.tar.gz