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

ci: build and publish at pypi/test-pypi #95

Merged
merged 13 commits into from
Aug 8, 2024
Merged

ci: build and publish at pypi/test-pypi #95

merged 13 commits into from
Aug 8, 2024

Conversation

almutlue
Copy link
Contributor

@almutlue almutlue commented Aug 6, 2024

Scope:

Two new github action workflows with 2 jobs each:

  • poetry-publish: 1. build modos-api and 2. publish at pypi, triggered on published releases
  • poetry-test-publish: 1. build modos-api and 2. publish at test-pypi, manually triggered by workflow dispatch

The publishing job uses trusted publisher management for authentication, which requires write permission. To not elevate privileges building and publishing were separated into two different ci-jobs as recommended.

Limitations:

So far only poetry-test-publish was run (see output) and tested. Both workflows are build analogous, but I think we have to wait for the next release to check poetry-publish?

@almutlue almutlue self-assigned this Aug 6, 2024
@almutlue almutlue requested a review from cmdoret August 6, 2024 11:20
@almutlue almutlue added the enhancement New feature or request label Aug 6, 2024
@almutlue almutlue linked an issue Aug 6, 2024 that may be closed by this pull request
Copy link
Member

@cmdoret cmdoret left a comment

Choose a reason for hiding this comment

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

This looks very good as-is, so I'm giving the ✔️
question(non-blocking): should we run tests in this workflow before build+release to avoid releasing broken code by accident?

@almutlue
Copy link
Contributor Author

almutlue commented Aug 7, 2024

Good point - I added a run-tests job that imports the test workflow to both workflows.
Both the building and publishing jobs depend on the test job to make sure that it fails early enough.

Publishing fails in the current test-publish action because the current version already exists at test-pypi. To solve this, it is suggested to make dev releases on pypi (see pypi/warehouse#726), but I thought it is not necessary, because the changes should not affect publishing?

@almutlue almutlue requested a review from cmdoret August 7, 2024 08:49
Copy link
Member

@cmdoret cmdoret left a comment

Choose a reason for hiding this comment

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

Very clean and DRY, 👍
We can test it with a minor release now that we have #96 merged

@almutlue almutlue merged commit 7f5a86a into main Aug 8, 2024
8 checks passed
@cmdoret cmdoret deleted the ci/poetry-publish branch August 8, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request]: Implement ci workflow for release
2 participants