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: add a github workflow to build and publish #749

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

florianvazelle
Copy link
Contributor

@florianvazelle florianvazelle commented May 13, 2024

Hi 👋

I submit a PR to build & publish the wheel in CI.

I don't know why, but no wheel is released on PyPI for the 2.6.0 version of django-celery-beat. So accordingly to the pypa example: Publishing package distribution releases using GitHub Actions CI/CD workflows, I add a workflow that automatically:

  • build the package on pull_request, the main branch and tags,
  • publish the wheel and the source tarball to PyPI, on pushed tag,

but required some configuration on the PyPI repo, to configure the workflow as a trusted publisher (see configuring-trusted-publishing).

  • create a Github Release, and upload the artifacts.

@florianvazelle
Copy link
Contributor Author

Hi 👋

After consideration, this change required some discussion:

  • I can merge the "release" workflow with the "test" workflow ? (And rename it for clarity)
  • Does this work with your release process ?
  • Do you want me to write a small RELEASE.md to explain the process ?
  • I can also make this change in django-celery-results to have the same CI/CD ?

@cclauss cclauss merged commit f852b81 into celery:main Jul 29, 2024
20 checks passed
@auvipy
Copy link
Member

auvipy commented Jul 29, 2024

I never had any report of not having any generation of wheel in the new releases I have been doing for years. Only 2.6 seems as an exception as I did not release it

@cclauss
Copy link
Contributor

cclauss commented Jul 29, 2024

I believe that I did the v2.6 release so I might have not done all the right steps.

It might be best for you to lead the v2.7 release @auvipy to verify the new process. We have enough updates...

@auvipy
Copy link
Member

auvipy commented Jul 30, 2024

I will try to do so. thanks for doing lots of work in the mean time! might ping you If I feel not sure about something!

@cclauss
Copy link
Contributor

cclauss commented Aug 4, 2024

@auvipy I know you are busy but the Django v5.1 release is scheduled on or around Wednesday.

The current release on PyPI will downgrade user dependencies on Django v5.1:

django-celery-beat: 2.6.0 --> 2.1.0
django-timezone-field: 7.0.0 --> 4.2.3

as discussed in

@cclauss
Copy link
Contributor

cclauss commented Aug 21, 2024

@florianvazelle

This failed to publish https://github.com/celery/django-celery-beat/releases/tag/v2.7.0 to PyPI at https://github.com/celery/django-celery-beat/actions/runs/10487732600/job/29048739728 with the message:

  • invalid-publisher: valid token, but no corresponding publisher (All lookup strategies exhausted)

Also, we wanted wheels built and published in this release but v2.7.0 seems that have source code but no wheels.

@florianvazelle
Copy link
Contributor Author

Hi @cclauss,

As I mention in the PR's description, the publishing step required some configuration on the PyPI repo, to configure the workflow as a trusted publisher (see configuring-trusted-publishing). Can you tell me if this step has been carried out correctly?

The wheels are therefore not published on the github release because the CI job was skipped due to the first error:

image

@cclauss
Copy link
Contributor

cclauss commented Aug 21, 2024

On https://pypi.org/manage/account/publishing I can manage other GitHub projects but I am unable to manage django-celery-beat so @Nusnus, @thedrow, or @auvipy will need to configure trusted publishing or increase my permissions.

@auvipy
Copy link
Member

auvipy commented Aug 21, 2024

We can do it manually as well

@wallies
Copy link

wallies commented Aug 21, 2024

Hi @cclauss,

As I mention in the PR's description, the publishing step required some configuration on the PyPI repo, to configure the workflow as a trusted publisher (see configuring-trusted-publishing). Can you tell me if this step has been carried out correctly?

The wheels are therefore not published on the github release because the CI job was skipped due to the first error:

image

@florianvazelle @cclauss
For the github release you can run always if previous steps fail like we do here for test pypi release https://github.com/quickwit-oss/tantivy-py/blob/master/.github/workflows/publish.yaml#L209

@cclauss
Copy link
Contributor

cclauss commented Aug 22, 2024

OK, but...

https://github.com/celery/django-celery-beat/actions/runs/10487732600 released to PyPI (Yeah!) but failed to Upload to GitHub Release.

I think we are OK because the Upload to GitHub Release error message was:

Run gh release create 'v2.7.0' --repo 'celery/django-celery-beat' --notes ""
HTTP 422: Validation Failed (https://api.github.com/repos/celery/django-celery-beat/releases)
Release.tag_name already exists

The remaining problem is that the release contains no wheels.

@cclauss
Copy link
Contributor

cclauss commented Aug 23, 2024

% pip install --upgrade django-celery-beat

Requirement already satisfied: django-celery-beat in ./.venv/lib/python3.12/site-packages (2.5.0)
Collecting django-celery-beat
  Downloading django_celery_beat-2.7.0-py3-none-any.whl.metadata (12 kB)

Even though I cannot find a wheel in the release artifacts, somehow one is created.

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.

6 participants