Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add onboarding guide for pypi GHA release #4270

Merged
merged 3 commits into from
Dec 15, 2023

Conversation

zelinh
Copy link
Member

@zelinh zelinh commented Dec 6, 2023

Description

Add onboarding guide for pypi GHA release

Issues Resolved

Part of opensearch-project/opensearch-build-libraries#222

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Zelin Hao <zelinhao@amazon.com>
Copy link

codecov bot commented Dec 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cc12806) 91.26% compared to head (a107069) 91.26%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4270   +/-   ##
=======================================
  Coverage   91.26%   91.26%           
=======================================
  Files         189      189           
  Lines        6124     6124           
=======================================
  Hits         5589     5589           
  Misses        535      535           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

ONBOARDING.md Outdated Show resolved Hide resolved
ONBOARDING.md Outdated

Since PyPi has announced the removal of the PGP signature [here](https://blog.pypi.org/posts/2023-05-23-removing-pgp/), it is no longer necessary to run our Jenkins workflow from Universal build as it was mainly focusing on signing.

With PyPi supporting [OpenID Connect (OIDC)](https://docs.pypi.org/trusted-publishers/adding-a-publisher/) authentication and the addition of trusted publisher on GitHub, the entire release publishing workflow can be executed on GitHub.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
With PyPi supporting [OpenID Connect (OIDC)](https://docs.pypi.org/trusted-publishers/adding-a-publisher/) authentication and the addition of trusted publisher on GitHub, the entire release publishing workflow can be executed on GitHub.
With PyPi supporting [OpenID Connect (OIDC)](https://docs.pypi.org/trusted-publishers/adding-a-publisher/) authentication and the addition of trusted publisher on GitHub, the entire release publishing workflow can be executed via GitHub Actions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review the latest commit to accommodate this change.

ONBOARDING.md Outdated
Comment on lines 91 to 96
Essential part of publishing to PyPi is:

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

which uses action [pypa/gh-action-pypi-publish](https://github.com/marketplace/actions/pypi-publish) for release. It has built-in support for trusted publishing.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Essential part of publishing to PyPi is:
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
which uses action [pypa/gh-action-pypi-publish](https://github.com/marketplace/actions/pypi-publish) for release. It has built-in support for trusted publishing.
Essential part of publishing to PyPi is using GitHub Action [pypa/gh-action-pypi-publish](https://github.com/marketplace/actions/pypi-publish) for release. It has built-in support for trusted publishing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

ONBOARDING.md Outdated Show resolved Hide resolved

### Step by step process

Sample workflow can be found [here](https://github.com/opensearch-project/opensearch-py/blob/5b28423f7145168d7263943ca4ae9722812e4771/.github/workflows/release-drafter.yml).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: We should not be naming the workflow as releas-drafter since the are not drafting the releases anymore via a single workflow. Maybe just release.yml works now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would still publish GitHub release.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but drafter's job was only to draft not release. That's why just release.yml makes more sense than drafter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I will keep the existing workflow with current name and for any of workflow to onboard in the future, let's name it just release.yml

ONBOARDING.md Outdated

For any of new repo to onboard GHA workflow release, there are two parts:

1. Create the GitHub workflow e.g. `release-drafter.yml` inside the repo.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same nit as above, release-drafter is misleading.

ONBOARDING.md Outdated Show resolved Hide resolved
ONBOARDING.md Outdated Show resolved Hide resolved
ONBOARDING.md Outdated Show resolved Hide resolved
Signed-off-by: Zelin Hao <zelinhao@amazon.com>
Signed-off-by: Zelin Hao <zelinhao@amazon.com>
@zelinh zelinh merged commit 551444a into opensearch-project:main Dec 15, 2023
13 checks passed
@zelinh zelinh deleted the py-gha branch December 15, 2023 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants