diff options
-rw-r--r-- | .github/workflows/release.yml | 37 | ||||
-rw-r--r-- | doc/release.md | 15 |
2 files changed, 39 insertions, 13 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..046af6f7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: Release + +on: + release: + types: + - published + +env: + DEFAULT_PYTHON: 3.9 + +jobs: + release-pypi: + name: Upload release to PyPI + runs-on: ubuntu-latest + steps: + - name: Check out code from Github + uses: actions/checkout@v2.3.4 + - name: Set up Python ${{ env.DEFAULT_PYTHON }} + id: python + uses: actions/setup-python@v2.2.2 + with: + python-version: ${{ env.DEFAULT_PYTHON }} + - name: Install requirements + run: | + python -m pip install -U pip twine wheel + python -m pip install -U "setuptools>=56.0.0" + - name: Build distributions + run: | + python setup.py sdist bdist_wheel + - 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/* diff --git a/doc/release.md b/doc/release.md index 7354b2e2..28b9c4ce 100644 --- a/doc/release.md +++ b/doc/release.md @@ -8,18 +8,7 @@ So, you want to release the `X.Y.Z` version of astroid ? 2. Install the release dependencies `pip3 install pre-commit tbump` 3. Bump the version and release by using `tbump X.Y.Z --no-push`. 4. Check the result. -5. Until the release is done via GitHub actions on tag, run the following commands: - -```bash -git clean -fdx && find . -name '*.pyc' -delete -python3 -m venv venv -source venv/bin/activate -pip3 install twine wheel setuptools -python setup.py sdist --formats=gztar bdist_wheel -twine upload dist/* -``` - -6. Push the tag. +5. Push the tag. ## Post release @@ -28,7 +17,7 @@ twine upload dist/* Move back to a dev version with `tbump`: ```bash -tbump X.Y.Z-dev0 --no-tag --no-push +tbump X.Y.Z-dev0 --no-tag --no-push # You can interrupt during copyrite ``` Check the result and then upgrade the master branch |