-
-
Notifications
You must be signed in to change notification settings - Fork 115
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: Fix conditions for building and publishing #313
Conversation
Based ont he github documentation: github.events.ref: Is the ref of a release that has been created github.ref: If the branch that is being used (depending on the action) - create a release: It will be refs/tags/<tag_name> - create a pull request: It will be refs/pull/<pr_number>/merge - push to a branch: It will be refs/heads/<branch_name> For publishing to pypi, we are targeting the "create a release" event. In which case: - github.events.ref will be refs/tags/<tag_name> - github.ref will also be refs/tags/<tag_name> So, it looks like our IF condition was incorrect. Ref: https://docs.github.com/en/actions/learn-github-actions/environment-variables
@AbdealiJK this seems very strange.
From what I can see from your suggested changes, this does not seem to be the case anymore? |
I don't think github actions has a way of detecting From what I read in the documentation ... The variables we are using are:
and the 2 events we enabled in the yaml file are: Leaving pull request aside for now ... Push can have 2 cases:
|
The github.event.ref and github.ref will always be same for the "push" event. So, we don't need to use github.event.ref in general.
When I am reading through the documentation again, I am realizing that we don't have a "create a release" event. We have a "push to tag" event And So, tweaking your logic:
In both events - push to master or version-tag we need to build the wheels |
yes I guess that's the best we can do. |
I believe the issue was introduced in where the IF conditions for both PR and Publish cases were being written In v1.9 from what I see, there were 2 separate yaml files being used each with their own |
Do you think the current implementation you've written here, will work? |
I believe so |
well here we go: https://github.com/JessicaTegner/pypandoc/actions/runs/3347112634 |
Based ont he github documentation:
github.events.ref: Is the ref of a release that has been created github.ref: If the branch that is being used (depending on the action)
For publishing to pypi, we are targeting the "create a release" event. In which case:
So, it looks like our IF condition was incorrect.
Ref: https://docs.github.com/en/actions/learn-github-actions/environment-variables