Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit f1dc7be

Browse files
Add github action to be able to release on published tag (#582)
* Add github action to be able to release on published tag * Use the pypi-prod environnement for releasing the package * Upgrade to use an environnement * handle the two environnement * Remove pypi-dev that made no sense, we should create another workflow * Take review comment into account See https://github.com/PyCQA/pydocstyle/pull/582\#discussion_r1060145450
1 parent a6fe422 commit f1dc7be

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/release.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
env:
9+
DEFAULT_PYTHON: "3.11"
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
release-pypi:
16+
name: Upload release to PyPI
17+
runs-on: ubuntu-latest
18+
environment:
19+
name: pypi-prod
20+
url: https://pypi.org/project/pydocstyle/
21+
steps:
22+
- name: Check out code from Github
23+
uses: actions/[email protected]
24+
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
25+
id: python
26+
uses: actions/[email protected]
27+
with:
28+
python-version: ${{ env.DEFAULT_PYTHON }}
29+
check-latest: true
30+
- name: Install requirements
31+
run: |
32+
python -m pip install twine build
33+
- name: Build distributions
34+
run: |
35+
python -m build
36+
- name: Upload to PyPI
37+
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
38+
env:
39+
TWINE_REPOSITORY: pypi
40+
TWINE_USERNAME: __token__
41+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
42+
run: |
43+
twine upload --verbose dist/*

0 commit comments

Comments
 (0)