A question
thealjey opened this issue ยท 10 comments
@AlexKVal
First of all, sorry if this isn't the right place to ask a question, I just didn't know how else to do it.
I have an existing project on which git tagging was never used (frankly, I'm not very familiar with that), there's a changelog.md file that was maintained by hand.
I want to introduce "release-script" & "mt-changelog" into the project, but I'm afraid I might mess something up (what will happen to my changelog, how can a new changelog be generated if I have no prior git tags, etc.)
Is there an easy to follow, step by step guide on how to integrate "release-script" & "mt-changelog" into a project like that for noobs like me?
Thank you and sorry for bothering.
HI ๐ You are not bothering at all.
I would manually git tag
your latest manual
commit / point you want.
After that commit / point mt-changelog
will include all in between - automatically (as it does in R-B
project).
Say you have your manual CHANGELOG.md
:
v1.0.1 - date - time - note
- I added this cool feature
- There was fixed that nasty bug-13
- Some neat changes were made
and your latest commit is e.g.
6a4f23
v1.0.1 release (that was done manually)
And at this point of time you've decided to use release-script
+ mt-changelog
.
First things first - you should do this:
> git tag v1.0.1
this will mark the "previous" release point for mt-changelog
.
All after that tag will be automatically added into CHANGELOG.md
.
(only those commits that have specific tags [added] [changed] [fixed]
)
> npm install -D release-script mt-changelog
> //add / make your changes
> git add && commit them with `[added] [changed] [fixed]` prefixes in commits headers
and when you decide to roll out your next release:
> npm run release patch // or whatever way you've choosen / decided to do it
That's all.
I hope it will help you ๐
p.s. I would strongly advise you to create kind of "prototype" trash project to check and train your ideas first ๐
I have three trash project exactly for this purpose
https://github.com/AlexKVal/es6-prototype-proj
https://github.com/AlexKVal/es6-prototype-proj-bower
https://github.com/AlexKVal/es6-prototype-proj.github.io
Feel free to ask additional questions here, reactiflux
Slack privately or by direct email.
To have an idea how it could look like you can take a look at R-B
commits log
https://github.com/react-bootstrap/react-bootstrap/commits/master
and then to its CHANGELOG.md
@AlexKVal
it worked! it worked perfectly! didn't screw up anything at all...
Thank you so, so much ๐
It is a pleasure to hear that for me.
I'm glad it helped you.
๐
@AlexKVal
Hi! It's me again ๐
Hope you're doing fine and I'm not wasting too much of your time.
Tried loggin into reactiflux
, but couln't because I was not invited into that team on slack.
I want to use the "docsRepo" option, but I have some questions:
- can "docsRepo" point to the same repo that the project itself is in?
- is the
gh-pages
branch created and managed byrelease-script
automatically, or do I need to create it myself? - I don't have an "original-project-name.github.io" subdomain, can I use this and have my documentation at "http://.github.io/original-project-name"?
-
because of this line src/release.js#L198 you cannot use your project's root folder as
docsRoot
. Otherwise you would end up with endless folders recursion. -
gh-pages
branch is not used at all.
(built) Documents are being published to their own github repository with their own<desired-name-for-documents-site>.github.io
domain.
I don't have an "original-project-name.github.io" subdomain
You could create it (https://pages.github.com/).
You just need to name the new repository as <your-desired-name>.github.io
and that's all.
E.g. https://github.com/react-bootstrap/react-bootstrap.github.io
See ? the name of the github repo is: react-bootstrap.github.io
and that's all.
For such names "http://<author>.github.io/original-project-name"
to work - you need to publish docs into gt-pages
branch. The release-script
doesn't support it.
react-bootstrap.github.io
is an organization type pages site, it only works like this because "react-bootstrap" also happens to be a user name (i.e. <author> === "react-bootstrap"
)
the problem is that my user name is very much different than the project name (and I don't plan on registering a new account for this) and there can only be one organization type site per user name
I managed to do it with an NPM "postpublish" hook, don't know if it's the right way to go, but it works ๐ถ
Thank you very much that you find the time to answer my questions, I really appreciate it ๐
I really like this project btw, it's super useful, simple, unpretentious, reliable and unopinionated (unlike "semantic-release", which shall remain nameless, lol).
It just gets the job done and is not getting in my way ๐
Thank you for your kind words ๐
To avoid the infinite folder recursion issue have you tried setting your tmpDocsRepo
to a folder like ../tmp-docs-repo-for-my-project
? That would clone the repo to a non-child folder and allow such a release. The only thing I don't think this would handle is the different branching to gh-pages. Though that could easily be added.
Though I don't think the infinite folder recursion would even happen. It just clones the repo to the folder you provide, it doesn't have any recursive logic in it. The only problem is the different branch than master really.
The elegant and really working solutions are always simple ๐
But "Simple is hard". (personally I did not hit upon the idea to move out tmp
folder to prevent recursion)
Thank you Matt ๐