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

Add github action to be able to release on published tag #582

Merged
merged 6 commits into from Jan 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,43 @@
name: Release

on:
release:
types:
- published

env:
DEFAULT_PYTHON: "3.11"

permissions:
contents: read

jobs:
release-pypi:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi-prod
url: https://pypi.org/project/pydocstyle/
steps:
- name: Check out code from Github
uses: actions/checkout@v3.2.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.4.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
- name: Install requirements
run: |
python -m pip install twine build
- name: Build distributions
run: |
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/*