Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: generate semantic release from the commit merged into main (#2576)
## What's the purpose of this pull request? Generate semantic release from the commit merged into main (PR title). We squash the commits before merging into main. The resulting commit will have by default the PR title. So we have to ensure that the PR title has this convention. TODO: Create an action to block merge button if the PR title is not following the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. Solutions: `lerna version --conventional-commits --yes` When run with this flag, lerna version will use the [Conventional Commits Specification](https://conventionalcommits.org/) to [determine the version bump](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-recommended-bump) and [generate CHANGELOG.md files](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-cli). WARNING: I wasn't able to validate the publish command in an easy way, but I'm guessing that if the versions are correct, publish will just send it to NPM. [thread with more details](https://vtex.slack.com/archives/C03L3CRCDC4/p1732651564186349) ## How it works? ![Captura de Tela 2024-12-02 às 10 41 54](https://github.com/user-attachments/assets/9ec87592-ff83-470d-9fe4-c6d35a56cf70) ## How to test it? Create a new branch and follow this steps: 1. Create a commit following Conventional Commits specification 2. Run the command `npx lerna version --conventional-commits --yes --no-push` . The command `--no-push` is very important to avoid push the tags. 3. Check the release version and changelog generated. 4. Now, Revert the changes to avoid side effects in the publish workflow. 5. Remove the changes: `git reset HEAD~1` 6. Remove the tag generated: `git tag -d [tag_version]`. Ex: `git tag -d v3.1.0` ## References Reference: https://github.com/lerna/lerna/tree/main/libs/commands/version#--conventional-commits
- Loading branch information