Skip to content

Commit ab07d5e

Browse files
authored
Merge pull request #5 from pylint-dev/release-job
2 parents 6be0547 + 56fa1d1 commit ab07d5e

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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
20+
url: https://pypi.org/project/pylint-pytest/
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+
# Remove dist, build, and pylint.egg-info
33+
# when building locally for testing!
34+
python -m pip install twine build
35+
- name: Build distributions
36+
run: |
37+
python -m build
38+
- name: Upload to PyPI
39+
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
40+
env:
41+
TWINE_REPOSITORY: pypi
42+
TWINE_USERNAME: __token__
43+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
44+
run: |
45+
twine upload --verbose dist/*

0 commit comments

Comments
 (0)