Skip to content

Commit 4d29805

Browse files
1 parent 2ce5ef1 commit 4d29805

File tree

2 files changed

+39
-13
lines changed

2 files changed

+39
-13
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
env:
9+
DEFAULT_PYTHON: 3.9
10+
11+
jobs:
12+
release-pypi:
13+
name: Upload release to PyPI
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out code from Github
17+
uses: actions/[email protected]
18+
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
19+
id: python
20+
uses: actions/[email protected]
21+
with:
22+
python-version: ${{ env.DEFAULT_PYTHON }}
23+
- name: Install requirements
24+
run: |
25+
python -m pip install -U pip twine wheel
26+
python -m pip install -U "setuptools>=56.0.0"
27+
- name: Build distributions
28+
run: |
29+
python setup.py sdist bdist_wheel
30+
- name: Upload to PyPI
31+
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
32+
env:
33+
TWINE_REPOSITORY: pypi
34+
TWINE_USERNAME: __token__
35+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
36+
run: |
37+
twine upload --verbose dist/*

doc/release.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,7 @@ So, you want to release the `X.Y.Z` version of astroid ?
88
2. Install the release dependencies `pip3 install pre-commit tbump`
99
3. Bump the version and release by using `tbump X.Y.Z --no-push`.
1010
4. Check the result.
11-
5. Until the release is done via GitHub actions on tag, run the following commands:
12-
13-
```bash
14-
git clean -fdx && find . -name '*.pyc' -delete
15-
python3 -m venv venv
16-
source venv/bin/activate
17-
pip3 install twine wheel setuptools
18-
python setup.py sdist --formats=gztar bdist_wheel
19-
twine upload dist/*
20-
```
21-
22-
6. Push the tag.
11+
5. Push the tag.
2312

2413
## Post release
2514

@@ -28,7 +17,7 @@ twine upload dist/*
2817
Move back to a dev version with `tbump`:
2918

3019
```bash
31-
tbump X.Y.Z-dev0 --no-tag --no-push
20+
tbump X.Y.Z-dev0 --no-tag --no-push # You can interrupt during copyrite
3221
```
3322

3423
Check the result and then upgrade the master branch

0 commit comments

Comments
 (0)