The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Automatically Releasing with TravisCI

Automatically Releasing with TravisCI

3:52
Now that we have everything set up with semantic-release and we have a feature commit, let's push that up and watch TravisCI use semantic-release do our library release automatically.
Watch this lesson now
Avatar
egghead.io

Now that we have everything set up with semantic-release and we have a feature commit, let's push that up and watch TravisCI use semantic-release do our library release automatically.

Avatar
Kent C.

Note, an alternative (and arguably better) solution is to create a test:watch and then remove the -w from the test command.

Avatar
Rodrigo

Hi Kent,

I have a node module that was at version 1.0.1. It was already configured and running on travis-ci. In this case, do I still have to change my package.json version tag to "0.0.0-semantically-released"?
I'm asking because after setting up semantic-release following your tips and committing with commitizen, on travis-ci a get the error when semantic-release pre is run:

"Failed to determine new version"

I also tried to make other changes, commit them, and before pushing them to Github, ran semantic-release pre on my notebook, getting the same error. What could be the problem?

Avatar
Kent C.

Hmmm.... Not sure what that could be. I would recommend you file an issue in the semantic-release repo with a link to your library. Good luck!

In reply to Rodrigo
Avatar
Philip

Hi Kent,
Great series!
I have followed along without a problem until this video.
I have navigated to the Travis URL in my account like you do at 1:04 in the video, but I do not see anything to say that my project is building or any CI running. I did see an issue reported with building on Mac's, could this be it? Thanks.

Phil

Avatar
Philip

I needed to have the travis.yaml file pre-pushed to the project before this would trigger. So I guess before I could automate the push, I had to do one last manual push :)

In reply to Philip
Avatar
Kent C.

Great! Glad you worked that out. Let me know if you have further questions :-)

In reply to Philip
Avatar
Philip

Thank you, Kent, I'm afraid I do.
My Travis build are timing out, the only errors I see are 'unable to download an optional dependency', but I read this should not be an issue. The only difference I have to your setup at the moment maybe is I don't have an SSH key setup to Github. So when I push, I manually enter my user and pw, I guess this could be fully pushing to Github before Travis has a chance? I have read about adding travis_wait to the :install life cycle of Travis, but you have to prefix this to failing command and I can't seem to find what that is :/

Just in case you fancy a look at the report :)
https://github.com/philipjc/starwars-names/issues/2

In reply to Kent C.
Avatar
Kent C.

You shouldn't need an SSH key, but you definitely need a GH_TOKEN environment variable which should have been set up for you by semantic-release-cli setup. Do you have that?

In reply to Philip
Avatar
Philip

I checked Github and it shows semantic-release create a access token, yes

In reply to Kent C.
Avatar
Kent C.

Could you link me to your repo?

In reply to Philip
Avatar
Kent C.

Found your problem... this line should say script, not before_script :-) cheers!

In reply to Philip
Avatar
Philip

Whhuuuut your kidding! Ha. Thank you so much for noticing that (it's getting late here :)) Apologies for using your time on something I should have noticed. Thank's again!

Update It worked!

In reply to Kent C.
Avatar
Jonathan

Off topic question, Kent Dodds. What is the landing page you use for chrome that has the font suggestions?

I'd like to download this, whether on chrome or firefox, to get more familiar with good typography fonts. Thanks!

Avatar
Kent C.

Good question! Do you mind asking on my AMA? http://faq.kentcdodds.com

In reply to Jonathan
Avatar
Steve

Any recommendations for taking this further to update/commit the changelog.md from the semantic-release/commitizen git data?

Avatar
Kent C.

Part of the beauty of using semantic-release is not having to manage a changelog at all. See what the angular-formly changelog looks like :-)

If you still want to have a changelog, I recommend you take a look at clog-cli

In reply to Steve
Avatar
Sergey

Is it true, that with semantic release your installed module doesn't know which version it is? I mean, normally I would implement command myModule -v, which reads version from package.json file. But with semantic release version in package.json doesn't change.

Avatar
Kent C.

No, the semantic-release pre script updates your package.json version field, so getting a version works fine (though during development it doesn't show the current version which is fine with me).

In reply to Sergey
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?