Skip to content

Commit 3f38150

Browse files
authored
ARROW-192 Add Trusted Publishing (#179)
* ARROW-192 Add Trusted Publishing * update release process * fix codeowners
1 parent dfc19ed commit 3f38150

File tree

3 files changed

+27
-11
lines changed

3 files changed

+27
-11
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Global owner for repo
2-
* @mongodb/dbx-python
2+
* @mongodb-labs/dbx-python

.github/workflows/release-python.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
branches: ["main"]
66
tags:
77
- "**"
8-
pull_request:
98
workflow_dispatch:
109

1110
concurrency:
@@ -120,7 +119,7 @@ jobs:
120119
name: "sdist"
121120
path: ./bindings/python/dist/*.tar.gz
122121

123-
collect-dist:
122+
collect_dist:
124123
runs-on: ubuntu-latest
125124
needs: [build_wheels, make_sdist]
126125
name: Download Wheels
@@ -134,5 +133,22 @@ jobs:
134133
find . -type d -empty -delete
135134
- uses: actions/upload-artifact@v3
136135
with:
137-
name: all-dist
136+
name: all-dist-${{ github.head_ref || github.ref_name }}
138137
path: "./*"
138+
139+
publish:
140+
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#publishing-the-distribution-to-pypi
141+
needs: [collect_dist]
142+
if: startsWith(github.ref, 'refs/tags/')
143+
runs-on: ubuntu-latest
144+
environment: release
145+
permissions:
146+
id-token: write
147+
steps:
148+
- name: Download all the dists
149+
uses: actions/download-artifact@v3
150+
with:
151+
name: all-dist-${{ github.head_ref || github.ref_name }}
152+
path: dist/
153+
- name: Publish distribution 📦 to PyPI
154+
uses: pypa/gh-action-pypi-publish@release/v1

bindings/python/RELEASE.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,11 @@ Release Process
4141
$ git push
4242
$ git push --tags
4343

44-
#. Download the release assets from the "Python Wheels" Github Workflow, e.g.
45-
https://github.com/mongodb-labs/mongo-arrow/actions/runs/2060477840.
44+
#. Pushing a tag will trigger the release process on GitHub Actions that will require a member of the team
45+
to authorize the deployment. Navigate to https://github.com/mongodb-labs/mongo-arrow/actions/workflows/release-python.yml
46+
and wait for the publish to complete.
4647

47-
#. Upload all the release packages to PyPI with twine::
48-
49-
$ python3 -m twine upload dist/*
50-
51-
#. Make sure the new version appears on https://mongo-arrow.readthedocs.io/en/latest/. If the
48+
#. Make sure the new version appears on https://mongo-arrow.readthedocs.io/en/stable/. If the
5249
new version does not show up automatically, trigger a rebuild of "latest":
5350
https://readthedocs.org/projects/mongo-arrow/builds/
5451

@@ -61,3 +58,6 @@ https://github.com/mongodb-labs/mongo-arrow/actions/runs/2060477840.
6158
The title should be "PyMongoArrow X.Y.Z", and the description should contain
6259
a link to the release notes on the the community forum, e.g.
6360
"Release notes: mongodb.com/community/forums/t/pymongoarrow-0-1-1-released/104574."
61+
62+
#. Wait for automated update PR on conda-forge, e.g.: https://github.com/conda-forge/pymongoarrow-feedstock/pull/24
63+
Update dependencies if needed.

0 commit comments

Comments
 (0)