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

Fix pypi deploy for patch releases #3113

Merged
merged 1 commit into from
Sep 16, 2022

Conversation

hoodmane
Copy link
Member

Apparently repository_dispatch only works on the main branch and what we need is workflow_dispatch. After we merge this, we can backport it to stable and I can do an ad-hoc test by trying to use it to deploy pyodide-build v0.21.3.

Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

Thanks!

@rth rth merged commit a53bc5f into pyodide:main Sep 16, 2022
@rth rth deleted the pypi-deploy-patch-releases branch September 16, 2022 06:47
hoodmane added a commit that referenced this pull request Sep 16, 2022
@hoodmane
Copy link
Member Author

Well this still doesn't work.

@ryanking13
Copy link
Member

I think it will work when we release a new version with a tag, as stable branch have no tag so CIRCLE_TAG would be empty.

@hoodmane
Copy link
Member Author

I don't think the curl request works at all. I haven't figured out how to make it work with WORKFLOW_DISPATCH. I'm trying to follow the directions here:
https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event

but I get the response:

{
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest/reference/actions#create-a-workflow-dispatch-event"
}

@ryanking13
Copy link
Member

https://github.com/pyodide/pyodide/actions/runs/3064780993 but I see it was triggered 3 days ago?

@hoodmane
Copy link
Member Author

That was a manual trigger from the web interface, not from curl. Since this PR was merged, I have been unable to trigger the job via curl.

Copy link
Member

@ryanking13 ryanking13 left a comment

Choose a reason for hiding this comment

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

That was a manual trigger from the web interface, not from curl. Since this PR was merged, I have been unable to trigger the job via curl.

Oh, okay. I thought that it was triggered by curl.

https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/dispatches \
-d '{"event_type":"deploy-release","client_payload":{}}'
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/dispatches/deploy-release \
Copy link
Member

@ryanking13 ryanking13 Sep 19, 2022

Choose a reason for hiding this comment

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

It seems like the order is different? (+ the filename)

/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches
Suggested change
https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/dispatches/deploy-release \
https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/actions/workflows/deploy_release.yml/dispatches \

Copy link
Member Author

Choose a reason for hiding this comment

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

Can create an API token and test this out? I tried a bunch of different variations like this and none of them were working for me. But maybe I was just being dumb.

Copy link
Member

Choose a reason for hiding this comment

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

I removed the type: [deploy-release] part in deploy_release.yml, and I was able to run a workflow with curl.

I think it was blocking a workflow run (it is mentioned in repository_dispatch docs, but probably it was also affecting workflow_dispatch:

When you make a request to create a repository_dispatch event, you must specify an event_type to describe the activity type.
By default, all repository_dispatch activity types trigger a workflow to run.
You can use the types keyword to limit your workflow to run when a specific event_type value is sent in the repository_dispatch webhook payload.

This was referenced Sep 21, 2022
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