Skip to content

Conversation

@weiji14
Copy link
Member

@weiji14 weiji14 commented Jan 3, 2025

Description of proposed changes

Have a dedicated build distribution job, and split the publish to TestPyPI and PyPI jobs, to workaround attestation file issue. Xref pypa/gh-action-pypi-publish#283

References:

Fixes #3736

Preview:

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash command is:

  • /format: automatically format and lint the code

Have a dedicated build distribution job, and split the publish to TestPyPI and PyPI jobs, to workaround attestation file issue. Xref pypa/gh-action-pypi-publish#283
@weiji14 weiji14 added the maintenance Boring but important stuff for the core devs label Jan 3, 2025
@weiji14 weiji14 added this to the 0.15.0 milestone Jan 3, 2025
@weiji14 weiji14 self-assigned this Jan 3, 2025
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0
persist-credentials: false
Copy link
Member

Choose a reason for hiding this comment

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

Any specific reason to add the persist-credentials: false line?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was from the template at https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#checking-out-the-project-and-building-distributions, so I just added it in. The default is persist-credentials: true according to https://github.com/actions/checkout/tree/v4.2.2?tab=readme-ov-file#checkout-v4, which would mean the credentials do not persist between jobs (e.g. from the build job to the publish-to-testpypi and publish-pypi jobs and is supposed to be less secure if I'm reading actions/checkout#485 correctly. Setting to persist-credentials: false should be more secure, though unsure if it really matters.

@weiji14 weiji14 marked this pull request as ready for review January 8, 2025 20:17
@seisman seisman merged commit 5041384 into main Jan 9, 2025
7 checks passed
@seisman seisman deleted the ci/split_publish_to_pypi branch January 9, 2025 04:37
@seisman seisman mentioned this pull request Jan 9, 2025
33 tasks
@weiji14 weiji14 modified the milestones: 0.15.0, 0.14.1 Jan 9, 2025
seisman added a commit that referenced this pull request Jan 17, 2025
@weiji14 weiji14 mentioned this pull request Mar 30, 2025
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Boring but important stuff for the core devs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix the "Publish to PyPI" workflow

3 participants