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
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0441486
Add github action to be able to release on published tag
Pierre-Sassoulas 342cc17
Use the pypi-prod environnement for releasing the package
Pierre-Sassoulas c9cb4be
Upgrade to use an environnement
Pierre-Sassoulas ea2f741
handle the two environnement
Pierre-Sassoulas 2093704
Remove pypi-dev that made no sense, we should create another workflow
Pierre-Sassoulas 1307d1f
Take review comment into account
Pierre-Sassoulas File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
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-dev | ||
url: https://test.pypi.org/project/pydocstyle/ | ||
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 -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/* |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direct invocation of
setup.py
is deprecated, current best practice is to usepython -m build
instead.