8000 .github: Add Automated release process (gh-251) · python/pyperformance@340008c · GitHub
[go: up one dir, main page]

Skip to content

Commit 340008c

Browse files
.github: Add Automated release process (gh-251)
* .github: Add Automated release process * rebase * Fix wrongly rebased code * Apply suggestions from code review Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com> * pyproject.toml: Address code review Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
1 parent b1aff44 commit 340008c

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

.github/workflows/publish.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# For more information, see the "Release a new version" notes in pyproject.toml.
2+
3+
name: Upload Python Package
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.x'
19+
cache: pip
20+
cache-dependency-path: pyproject.toml
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade build
24+
- name: Build
25+
run: |
26+
python -m build
27+
- name: Publish distribution 📦 to PyPI
28+
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
29+
uses: pypa/gh-action-pypi-publish@release/v1
30+
with:
31+
user: __token__
32+
password: ${{ secrets.PYPI_API_TOKEN }}

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@
1616
# - check the CI status:
1717
# https://github.com/python/pyperformance/actions
1818
#
19-
# Release a new version:
19+
# Release a new version with GitHub (preferred):
20+
#
21+
# - go to the GitHub release tab: https://github.com/python/pyperformance/releases
22+
# - click "Draft a new release" and fill the contents
23+
# - finally click the "Publish release" button! Done!
24+
# - monitor the publish status: https://github.com/python/pyperformance/actions/workflows/publish.yml
25+
#
26+
# Release a new version manually:
2027
#
2128
# - git tag VERSION
2229
# - git push --tags

0 commit comments

Comments
 (0)
0