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

Added release workflow #48

Merged
merged 7 commits into from
Aug 22, 2024
Merged

Added release workflow #48

merged 7 commits into from
Aug 22, 2024

Conversation

santacodes
Copy link
Collaborator

Added release.yml file referred from PyPI OIDC docs.

Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

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

This isn't correct – the PyPI docs are likely truncated and display only a truncated part of what is needed to be added. You'll need to build an sdist and a wheel in one job using pypa/build (I like https://github.com/hynek/build-and-inspect-python-package), upload their artifacts, download them in another job, and and trigger the publishing from that job.

Also, you might have done this already, but please ensure that the name of the workflow file matches that set in the PyPI settings for pybamm-cookie that you might have set up by now (if you have, please feel free to add us there!) and that the name of the environment you added matches the one in the environment: section here, i.e., release.

@santacodes
Copy link
Collaborator Author

@agriyakhetarpal @Saransh-cpp sorry for the delay, could you verify if the release workflow is now valid? pypa/gh-action-pypi-publish@release/v1 action by default looks for the sdist and whl from the dist/ directory so a simple python -m build should do it I guess?

Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

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

No, this still isn't valid, but the structure is getting towards the right place!

  • The idea is to build the sdist and wheel in an entirely separate job, upload them as artifacts (you're right – both can be kept in a dist/ folder).
  • We don't need to set up uv, GHA runners come with pipx by default, so you can just run pipx run build instead of python -m build.
  • Then, in a separate Ubuntu job, download the artifacts, and grant just that job id-token: write permissions – the separation of the jobs is important for security reasons: please read the end of the Trusted publishing section of the documentation.

Also, the latest release of pypa/gh-action-pypi-publish is v1.9.0, could you update that and set it to point to the hash of the v1.9.0 commit? I'll suggest a change below for it.

.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
Co-authored-by: Agriya Khetarpal <[email protected]>
@agriyakhetarpal
Copy link
Member

agriyakhetarpal commented Aug 22, 2024

Thanks for the fixes, @santacodes! Let's create the release in the meeting a short while from now.

@santacodes santacodes merged commit 1ae8dbd into pybamm-team:main Aug 22, 2024
84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants