DEV Community

Devansh Shah
Devansh Shah

Posted on

FireLinker + Semantic Release

This week, I added auto semantic release to firelinker. This blog will go through how I did this. The way I did this was using the instructions on this repo https://github.com/zeke/semantic-release-with-github-actions allowed me to add it successfully. The process was very simple after I found this repo.

At first the most difficult part was connecting to npm registry but after I got my account and token and figured out about GitHub secrets I added an NPM_token to secrets. I also realized that GitHub already has a secret github_token saved automatically once created. The process on the repo is very simple but it requires to do squash merge commits.

The repo has the following steps

- [ ] Only allow squash merging of pull requests
- [ ] Install https://github.com/apps/semantic-pull-requests
- [ ] Create npm token using `npm token create` or https://www.npmjs.com/settings
- [ ] Add token to repo secrets as `NPM_TOKEN`
- [ ] Add release workflow file to `.github/workflows/release.yml`
- [ ] Set `version` to `0.0.0-development` in package.json
- [ ] `npm i -D semantic-release`
- [ ] Use semantic commit messages
- [ ] Create a pull request 
Enter fullscreen mode Exit fullscreen mode

The steps are very easy to follow with a great result. After, I added semantic release I had a couple friends test it and it worked just like before because I was first just installing it from the repo but now I'm doing it from the npm registry https://www.npmjs.com/package/firelinker/v/1.0.0

Overall, this process was very awesome with a few extra steps I have automated my release from this day. The way it works is it releases on each push to master and automatically decides the versioning useing commit messeages.

Discussion (0)