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

Ability to add other artifacts to the release commit #96

Closed
JaKXz opened this issue Aug 24, 2016 · 11 comments
Closed

Ability to add other artifacts to the release commit #96

JaKXz opened this issue Aug 24, 2016 · 11 comments

Comments

@JaKXz
Copy link
Contributor

JaKXz commented Aug 24, 2016

ATM, I'm amending because I want the produced artifacts to be part of the chore(release): x.x.x commit.

"prerelease": "webpack -p --bail", //produces some bundle artifacts that I want to commit
"release": "standard-version -s",
"postrelease": "git commit -a --amend --no-edit"

However, because of the way git works this creates a new commit object since the original commit is tagged before the amend happens. What would be nice is if my postrelease script was really a poststandard-version script (i.e. a "lifecycle-style" hook like the npm run script itself).

cc @stevemao @bcoe

@gkatsev
Copy link

gkatsev commented Aug 26, 2016

Been looking at using standard-version for videojs. We basically do this for pre-build bundles for bower users or other users who don't want to use a bundler.
A potentially easy change is to be able to run the tagging portion of standard-version separately. So, you run the changelog generator, it doesn't commit or tag yet, then, you run your build script and then run the commit/tagging portion.
Or you could accept a command to run before committing. Kind of like you can do an npm version script that builds a release and adds the changes to git.

@JaKXz
Copy link
Contributor Author

JaKXz commented Oct 7, 2016

@bcoe @stevemao thanks for v3.0! :) do you guys have any thoughts on this though?

@bcoe
Copy link
Member

bcoe commented Oct 7, 2016

@JaKXz I'm not opposed to this idea, would love to make sure we support a few common workflows; is there an approach that you think would work well for both your and @gkatsev's use-case?

@Tapppi
Copy link
Member

Tapppi commented Oct 7, 2016

@bcoe @gkatsev @JaKXz Is there still a need for a hook between git add and git commit/tag? Does v3.0 and --commit-all not enable this, since artifacts built before the release script will be added to the commit?

"prerelease": "webpack -p --bail",
"release": "standard-version --commit-all" // Could replace --commit-all with -a

I'm not against supporting a "lifecycle-hook" between the add and commit/tag (e.g. standard-version-pre-commit or something less verbose) but at least this use-case seems to be covered.

@gkatsev
Copy link

gkatsev commented Oct 7, 2016

I think that --commit-all could potentially work for my usecase. It seems similar to what I've done with the built-in version script:

"version": "npm run build && git add -f dist/"

Then when npm's versioning runs, it just commits the entire thing.

@Tapppi
Copy link
Member

Tapppi commented Oct 7, 2016

Great! I think this issue can technically be closed, since you can commit any artifacts built before standard-version with --commit-all. Just gonna wait for @JaKXz to confirm that this works for him as well.

@Tapppi
Copy link
Member

Tapppi commented Oct 7, 2016

Actually we should keep this issue open to track documentation relating to this use-case.

@JaKXz
Copy link
Contributor Author

JaKXz commented Oct 7, 2016

@Tapppi --commit-all works! Thanks so much :D

@JaKXz
Copy link
Contributor Author

JaKXz commented Oct 7, 2016

...actually, I may have spoken too soon. I had to add the built assets to the release commit myself.

@JaKXz
Copy link
Contributor Author

JaKXz commented Oct 7, 2016

Based on #121 it looks like I have to git add . before standard-version -as.

Yes - documentation on this would be great: I can try to write something up tonight but can't promise free time so if someone else can do it please do #127.

@Tapppi
Copy link
Member

Tapppi commented Oct 8, 2016

Yes, currently the commit-all flag just commits already staged changes. That might seem confusing, but I actually think it allows for greater control over the process. Needs to be clear in the documentation though. I'll take a look at the pr soon when I'm on my comp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants