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

Autorelease functionality #304

Closed
wants to merge 18 commits into from
Closed

Autorelease functionality #304

wants to merge 18 commits into from

Conversation

JimNero009
Copy link

Allow the release drafter to auto-publish the releases it drafts, if a user so wants.
Works by inspecting labels on the PRs that have gone into making the draft, then publishing the draft with the version that best fits.

package.json Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@jetersen
Copy link
Member

https://github.com/toolmantim/release-drafter/commit/dfc1c77d8720475b9a89f4e619675dbf3db85c0d.patch

@JimNero009
You might want to set up an email alias on your GitHub account 🥇
Or look into fixing your git user.email config 😅
to get proper credit for your commits 🏆
https://help.github.com/articles/adding-an-email-address-to-your-github-account/
https://help.github.com/articles/setting-your-commit-email-address-in-git
then to amend your commits: https://stackoverflow.com/a/3042512

@JimNero009
Copy link
Author

JimNero009 commented Sep 11, 2019

Thanks for the tip @jetersen -- done that now.

index.js Outdated
context.repo({
release_id: releaseId,
draft: false,
name: thisVersion, // TODO - how should name and tag_name behave here?
Copy link
Author

Choose a reason for hiding this comment

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

WDYT?

Copy link
Author

@JimNero009 JimNero009 Sep 17, 2019

Choose a reason for hiding this comment

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

@jetersen What is the kind of thing you would like to see here? I'm starting to think that this has a fundamental flaw, and that I actually need to go back a few steps and interrupt the templating process for the name and tag variables to make sure they correspond to the version that is just about to be released?

Copy link
Member

Choose a reason for hiding this comment

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

From above you should have:
https://github.com/toolmantim/release-drafter/blob/4e0c93d4a6c5296d865ca2dcd1e4c54d9058c531/index.js#L71-L76

you should have access to releaseInfo.name and releaseInfo.tag

Perhaps your incrementVersionBasedOnLabels should update the releaseInfo.tag?

Copy link
Author

Choose a reason for hiding this comment

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

Ah, of course! Not sure how I didn't see that.
So yeah -- when generating the release info, I can just hook right into that and get it to resolve to different version numbers based on labels. Shouldn't be too difficult... 😅

@JimNero009 JimNero009 changed the title [WIP] Autorelease functionality Autorelease functionality Sep 12, 2019
index.js Outdated
context.repo({
release_id: releaseId,
draft: false,
name: thisVersion, // TODO - how should name and tag_name behave here?
Copy link
Member

Choose a reason for hiding this comment

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

From above you should have:
https://github.com/toolmantim/release-drafter/blob/4e0c93d4a6c5296d865ca2dcd1e4c54d9058c531/index.js#L71-L76

you should have access to releaseInfo.name and releaseInfo.tag

Perhaps your incrementVersionBasedOnLabels should update the releaseInfo.tag?

lib/versions.js Show resolved Hide resolved
@IncPlusPlus
Copy link

Hi @JimNero009. I think that the autorelease functionality you're planning here is fantastic. However, the reason I found this PR is for a different reason. I'm super excited about the idea of having labels determine what part of the version gets incremented. (After I found this PR, I also ran across #256 (comment) so I'm linking it just to have the cross-references to help people searching about this feature).

I have one quick question. Is the conditional incrementing a feature that will be tightly coupled with the autoreleases or would I be able to use the label-based increments without having the auto-publish functionality enabled? Keep up the great work!

@jetersen
Copy link
Member

jetersen commented Oct 3, 2019

We could easily decouple auto-release from label increment.

@JimNero009
Copy link
Author

Indeed -- we can probably just make https://github.com/toolmantim/release-drafter/pull/304/files#diff-168726dbe96b3ce427e7fedce31bb0bcR26-R30 a more general config block that contains an auto-release flag, rather than the config block containing all information pertinent only to an auto-release

@herecomesjaycee
Copy link

Upvoting this feature, would be amazing to have this

@IncPlusPlus
Copy link

Thanks for the replies. I'm looking forward to it. It'll make my release cycle dead simple.

@Remzi1993
Copy link

Remzi1993 commented Oct 13, 2019

@jetersen @IncPlusPlus @herecomesjaycee @JimNero009 Thank you guys! I would love to see these features implemented. I'm also upvoting this feature 👍

@JimNero009
Copy link
Author

JimNero009 commented Oct 15, 2019

The commit before this message decouples the templating-by-labels and the auto-release functionality.

@JimNero009
Copy link
Author

JimNero009 commented Oct 15, 2019

@jetersen Think the code is in a decent place again, would appreciate another look. If all looks good with you, I'll do a proper integration test tomorrow.

@planetflash
Copy link

Any update on this? Would love this feature too 🙏

@JimNero009
Copy link
Author

I do still need to properly test this on a real repository, as it were, just to add confidence to the automated testing. Other than that, I think it's 'just' a code review away!

@TimonVS
Copy link
Member

TimonVS commented Dec 23, 2019

Hey @JimNero009, thanks a lot for the effort! I've put some of my thoughts about this in the issue here: #141 (comment). Please let me know what you think of this idea.

@orcutt989
Copy link

Has the publish functionality been implemented?

@jetersen
Copy link
Member

I think this superseded by #424 and #513

@jetersen jetersen closed this May 28, 2020
@jetersen
Copy link
Member

jetersen commented Jun 1, 2020

@JimNero009 #546 will most likely fit the bill, we are removing the constraint that we had placed on GitHub actions 😆

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.

None yet

8 participants