Skip to content

ci: Update setup for publishing #100

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

Open
wants to merge 34 commits into
base: gpeacock/py_publish
Choose a base branch
from

Conversation

tmathern
Copy link
Collaborator

@tmathern tmathern commented May 7, 2025

Targets #94.

Details about the update are logged in the comments on the PR (see below).

Example runs:

@tmathern tmathern self-assigned this May 7, 2025
@tmathern tmathern changed the base branch from gpeacock/py_publish to main May 7, 2025 23:35
@tmathern tmathern changed the title ci: Update setup ci: Update setup for publishing May 7, 2025
@tmathern tmathern changed the base branch from main to gpeacock/py_publish May 7, 2025 23:51
@@ -0,0 +1,98 @@
name: Upload Test for Pypi.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note: Came in when I merged in latest main, did not make changes here in that PR.

python3 ./tests/test_api.py

publish: release
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Came in with latest main too

@@ -3,7 +3,7 @@ requires = ["maturin>=1.7.4,<2.0","uniffi_bindgen>=0.28,<0.30"]
build-backend = "maturin"

[project]
name = "c2pa"
name = "c2pa-python"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That name needs to match what is in PyPI for Trusted publishing.


[tool.maturin]
module-name = "c2pa"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because we had to update the name above for trusted publishing, now we need this to "fix" the package name.

runs-on: ubuntu-latest
environment: Publish
environment: pypipublish
Copy link
Collaborator Author

@tmathern tmathern May 7, 2025

Choose a reason for hiding this comment

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

The environment needs to match what is set in trusted publishing on PyPI (and it's case-sensitive). Unfortunately, it can do only lower case environments, so the env in github needs to be all lowercase too.

id-token: write
contents: read
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added one more permission so we're sure the token can be used, and the contents we're dealing with, read

@tmathern tmathern requested a review from gpeacock May 7, 2025 23:58
@tmathern tmathern marked this pull request as ready for review May 7, 2025 23:58
@tmathern tmathern deployed to pypipublish May 8, 2025 00:25 — with GitHub Actions Active
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.

3 participants