Automating Releases with semantic-release

InstructorKent C. Dodds

Share this video with your friends

Send Tweet

There are so many repeated steps when releasing a new version of a library. The tool semantic-release automates this process by pushing off the responsibility of your releases to continuous integration. Trust us, this will change your workflow for the better.

Juanmnl Cornejo
~ 9 years ago

I'm having a problem on travis build. It stalls while launching the tests. I'm sure the -w flag is responsible so i removed it. I've pushed the changes to github, but when relaunching the build on travis, the test command still has the -w flag. How do i update the github project on travis. (tried removing and adding again w/ no success)

Kent C. Doddsinstructor
~ 9 years ago

I actually recommend that your test script not have the -w flag (even though that's what I originally did in the video) and in your .travis.yml, make sure that your script runs npm run test. I do in angular-formly

Good luck!

Juanmnl Cornejo
~ 9 years ago

Hey! Thanks for the quick answer! Everything worked after waiting a bit (the new commit arrived and everything went green). Guess i'll wait for the commit to propagate next time :)

Leo
~ 9 years ago

Hi Kent, thanks a lot for sharing this amazing library. I just have 2 steps that I'm struggling with.

  1. I use gulp-header that reads my package.json to insert the correct version as annotations in my .min.js, however, semantic-release don't let any version into the package.json, do you have an alternative, for it? Thanks?

  2. How would publish bower? Do I need to create a tag on my own? Thanks

Kent C. Doddsinstructor
~ 9 years ago

Hi Leo! So... Two things

  1. Just run gulp-header after semantic-release pre. You'll see that I changed the semantic-release script in angular-formly here. semantic-release pre will set the version in package.json.
  2. Don't publish to bower. It's dead. However, semantic-release does create a tag for you, so it should just work out of the box.
Leo
~ 9 years ago

Hi Kent,

Many thanks for your reply.

  1. Allright, I'll run semantic-release pre, than gulp-header. That's really cool. I just need to make sure all my PR helpers use the correct commit messages convention. (I found out you wrote a lib to force that, I'll try it)

  2. I've read about replace bower to npm, however this won't be done to quickly. I'm still have many users from bower in my lib. I realized that created a tag. It should be fine though.

Awesome video btw!

Jakub Antolak
~ 6 years ago

Hi! Each time I run semantic-realease with --publish flag, I get the GitHub token error although the token is set. However, the script without this flag creates correct releases on GitHub while running in CI. But it misses to publish the package on npm so I have to set the version in package.json manually...

Joonas Kallunki
~ 6 years ago
Babs Craig
~ 6 years ago

In case anyone runs into this error: ERR! semantic-release Error: Unable to find repo id for "{REPO_NAME_HERE}" after selecting TravisCI in the setup, you might want to sign up for TravisCI first and then add the repo to your TravisCI dashboard.