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 github actions for non-release tags #235

Merged
merged 2 commits into from
Mar 16, 2020
Merged

Fix github actions for non-release tags #235

merged 2 commits into from
Mar 16, 2020

Conversation

shyamd
Copy link
Contributor

@shyamd shyamd commented Mar 16, 2020

This should fix #229 and ensure that the release workflow only runs on tags made via the release tab on Github. We should also start including changelog summaries in those release descriptions.

@codecov
Copy link

codecov bot commented Mar 16, 2020

Codecov Report

Merging #235 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #235   +/-   ##
=======================================
  Coverage   87.57%   87.57%           
=======================================
  Files          43       43           
  Lines        1916     1916           
=======================================
  Hits         1678     1678           
  Misses        238      238
Flag Coverage Δ
#unittests 87.57% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ead73d...9c3cef0. Read the comment docs.

@shyamd shyamd requested review from CasperWA and ml-evs March 16, 2020 16:51
@ml-evs
Copy link
Member

ml-evs commented Mar 16, 2020

@CasperWA was much more diligent than me when making releases. The PR's for the tagged commits have all the changes summarised (see the 0.6 tag). This looks like a sensible way of proceeding though!

EDIT: unfortunately it seems like you can't edit the description of a release post hoc.

@CasperWA
Copy link
Member

This should fix #229 and ensure that the release workflow only runs on tags made via the release tab on Github. We should also start including changelog summaries in those release descriptions.

Yeah, I thought to at least put in the effort for each release, then it would be easy later to do proper GitHub releases, as well as add a CHANGELOG.md or something.

@CasperWA
Copy link
Member

EDIT: unfortunately it seems like you can't edit the description of a release post hoc.

You can if you make it a proper release on GitHub. Go to tags and choose the tag you want to release, and release it :)

@@ -5,6 +5,13 @@ on:
tags:
# After vMajor.Minor.Patch _anything_ is allowed (without "/") !
- v[0-9]+.[0-9]+.[0-9]+*
branches:
Copy link
Member

Choose a reason for hiding this comment

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

I don't know that this will work, but the release should do it, I belieeve.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The combination of both do it.

Copy link
Member

Choose a reason for hiding this comment

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

Could we test it with some a pre-release tag?

Copy link
Member

Choose a reason for hiding this comment

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

(after merging)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can just do a patch release v0.7.1

Copy link
Member

Choose a reason for hiding this comment

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

The combination of both do it.

I'm not sure the github actions logic work this way, is my only concern. It's not AND statements, but rather OR as I understand it, but I may definitely be wrong, since it also seems to update a bit at the moment.

Copy link
Member

Choose a reason for hiding this comment

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

Seeing the actions run (here) it seems clear it's an OR logic, i.e., the workflow ran on a push to the branch master. But didn't release on PyPI only due to the check in the code that the version in __init__.py doesn't match.

@ml-evs
Copy link
Member

ml-evs commented Mar 16, 2020

EDIT: unfortunately it seems like you can't edit the description of a release post hoc.

You can if you make it a proper release on GitHub. Go to tags and choose the tag you want to release, and release it :)

Weird, assumed it would republish/duplicate the release based on the options I was given, but it has just updated it fine. So 0.6 and 0.7 now have the markdown changelogs. I don't think we need to worry about the others.

Copy link
Member

@ml-evs ml-evs left a comment

Choose a reason for hiding this comment

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

LGTM, let's test it once it's merged though with 0.7.1. Would you mind squash merging it @shyamd?

@shyamd shyamd merged commit 16917b2 into Materials-Consortia:master Mar 16, 2020
@CasperWA
Copy link
Member

So I think this doesn't work.
Looking into the documentation of GitHub Actions The releases should be alongside push, not tags and branches.
Furthermore, I am now pretty sure this means that the workflow will run for pushes of tags that matches the pattern, as well as for branches matching master. I.e., the requirements for when the workflow will run has simply been expanded, not restricted.

However, there are two options as I understand it:

  1. Either drop this, and only run the workflow upon publishing a release.
    This has the advantage that we need to create a proper GitHub release.
    The disadvantage is if the workflow/publication fails, I am not sure a GitHub published release can be deleted and redone?
  2. Apply further constraints in the if value at jobs.publish.if. If it's possible to get information about the branch the commit is on that the tag is referring to, or similar, it will effectively do the AND constraint that was intended with this PR.
    This has the advantage of doing what the PR wanted (I presume), as well as making sure we only publish when pushing a valid tag to master.
    The disadvantage must be that we don't automatically enforce the GitHub releases?

Personally, I vote to try the second option first, and if it's not possible, then turn to option one?

@shyamd
Copy link
Contributor Author

shyamd commented Mar 18, 2020

Let's try the second option.

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.

Release only when pushing to master
3 participants