From fef8de4025d4dacb898f5676ca0018b6c686f1f4 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Sat, 3 Dec 2022 22:19:16 +0900 Subject: [PATCH 1/5] .github: Add Automated release process --- .github/workflows/publish.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..a4be056d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: Upload Python Package + +on: + release: + types: [created] + +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' + - name: Install dependencies + run: | + python -m pip install --user --upgrade setuptools wheel + - name: Build + run: | + python setup.py sdist bdist_wheel + - name: Publish distribution 📦 to PyPI + if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From becbad46965dba59c971f2ea752a968a32a4af94 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Tue, 6 Dec 2022 04:59:13 +0900 Subject: [PATCH 2/5] rebase --- pyproject.toml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b7e6ecad..0cc26694 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,11 +18,10 @@ # # Release a new version: # -# - git tag VERSION -# - git push --tags -# - Remove untracked files/dirs: git clean -fdx -# - python -m build -# - twine upload dist/* +# - 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 # # After the release: # From 2f79b53b255ced3dfa64df825be4a873c98f3071 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Tue, 6 Dec 2022 12:59:14 +0900 Subject: [PATCH 3/5] Fix wrongly rebased code --- .github/workflows/publish.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a4be056d..a2b38729 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,7 +2,7 @@ name: Upload Python Package on: release: - types: [created] + types: [published] jobs: deploy: @@ -14,15 +14,17 @@ jobs: 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 --user --upgrade setuptools wheel + python -m pip install --upgrade build - name: Build run: | - python setup.py sdist bdist_wheel + 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@master + uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} From b3a0d436afd3fd8269248b55f0d7375af4fbfd3e Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Wed, 7 Dec 2022 21:30:33 +0900 Subject: [PATCH 4/5] Apply suggestions from code review Co-authored-by: Eric Snow --- .github/workflows/publish.yml | 2 ++ pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a2b38729..8c6e30f1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,3 +1,5 @@ +# For more information, see the "Release a new version" notes in pyproject.toml. + name: Upload Python Package on: diff --git a/pyproject.toml b/pyproject.toml index 0cc26694..7192b7f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ # # - 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! +# - finally click the "Publish release" button! Done! (see .github/workflows/publish.yml for what gets run) # - monitor the publish status: https://github.com/python/pyperformance/actions/workflows/publish.yml # # After the release: From 75eb7551b01943eb25657fc83458879dc16a9df0 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Wed, 7 Dec 2022 21:31:47 +0900 Subject: [PATCH 5/5] pyproject.toml: Address code review --- pyproject.toml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7192b7f6..f69c39c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,13 +16,21 @@ # - 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! (see .github/workflows/publish.yml for what gets run) +# - 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 +# - Remove untracked files/dirs: git clean -fdx +# - python -m build +# - twine upload dist/* +# # After the release: # # - set version to n+1: pyperformance/__init__.py and doc/conf.py