Skip to content

Commit

Permalink
.github: Add Automated release process (pythongh-251)
Browse files Browse the repository at this point in the history
* .github: Add Automated release process

* rebase

* Fix wrongly rebased code

* Apply suggestions from code review

Co-authored-by: Eric Snow <[email protected]>

* pyproject.toml: Address code review

Co-authored-by: Eric Snow <[email protected]>
  • Loading branch information
corona10 and ericsnowcurrently authored Dec 7, 2022
1 parent b1aff44 commit 340008c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# For more information, see the "Release a new version" notes in pyproject.toml.

name: Upload Python Package

on:
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade build
- name: Build
run: |
python -m build
- name: Publish distribution 📦 to PyPI
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@
# - check the CI status:
# https://github.com/python/pyperformance/actions
#
# Release a new version:
# Release a new version with GitHub (preferred):
#
# - go to the GitHub release tab: https://github.com/python/pyperformance/releases
# - click "Draft a new release" and fill the contents
# - finally click the "Publish release" button! Done!
# - monitor the publish status: https://github.com/python/pyperformance/actions/workflows/publish.yml
#
# Release a new version manually:
#
# - git tag VERSION
# - git push --tags
Expand Down

0 comments on commit 340008c

Please sign in to comment.