Closed wahengchang closed 5 years ago
Hi @wahengchang 👋 It seems like you are almost done. I've found the same issue and in my case was related to how Lerna handles their lifecycle scripts. I was thinking it was something similar to what npm or yarn does (e.g.: preversion, version, postversion, etc). But it's different.
To solve that I've added one extra step, the lerna:postversion
piece.
The problem basically is that you have uncommitted files on travis. So, you can look for that. Something is being modified inside of your ci/cd pipeline.
In this case your postversion script is the one I recommend to automatically update your changelog using chan
. According to your package devdeps, chan
is missing. You should install it or remove the whole postversion part.
If you want to have a partially automated changelog 🆒 as a part of your project, you should install chan as a dev dep, then run npx chan init
, this only needs to run once to generate a valid CHANGELOG.md file and push the new file.
Hope this helps. 👍
@dpaez , i spent another morning to try out, and did all you mentioned.
the script fail in lerna:publish
, as the reason EUNCOMMIT Working tree has uncommitted changes
.
I am thinking if it is a problem caused by different lerna version ? is your repo still working ? would you mind providing the travis-ci web for reference ?
I am building a CICD for my team, to build and publish a new version on npm for each commit on master branch. Working with lerna and travis-ci is harder than I imagine.
Hi @wahengchang. This is the travis-ci web output/config for one of our last releases. Check it out.
I don't think different lerna versions are the problem since we are on the same major number.
I think the Travis script part should only run a few commands, like lerna:publish
. This one will trigger others.
Also, how are you starting the procedure? I mean, according to the info provided on this test repo, one first run yarn run lerna:version
this creates a tagged commit and push it to the repo. Travis then detects this tagged commit (thanks to the tags: true
config) and starts the 2nd part, the publish one.
I am digging into A. Fully "automatic"
part.
my work flow:
I did all the same as the repo you provided (copy paste package.json
and .travis.yml
), is it the right way?
Ok, I thought you were trying to use the other workflow ("half & half"). Take a look on this package.json (branch: fully-auto).
You will see that the version script does not call the lerna:postversion
hook.
I think that will help you. 👍
Hi @wahengchang, have you made some progress with this?
I'm closing this since there was no update. Feel free to re-open if the issue persists.
close it plz, i dont have a crew what is going wrong. i did not work on the CI/CD for few week, i will be back in the future.
thx dp :)
I think everything is setup well , but still seeing this error. Do you have a crew about what is going wrong? I spent few days seting up this CI/CD
NPM_TOKEN
is init on the configtravis-ci