Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): add automated release workflow #2

Merged
merged 9 commits into from
Jul 11, 2023

Conversation

rebornplusplus
Copy link
Member

Adds a workflow file which can be run to create a semantic tag and immediately afterwards, create a GitHub release. Any collaborator with write access should be able to trigger the workflow.

This PR also adds another workflow file, which leaves a comment after a PR has been merged. The comment reminds to trigger the aforementioned release workflow.

The tags will be automatically created using semantic versioning. However, the very first tag should be specified manually in the workflow input. The release types (patch, minor or major) are determined by the commit messages. Please see https://github.com/marketplace/actions/github-tag#bumping to learn more.

The action will parse the new commits since the last tag using the semantic-release conventions.

semantic-release uses the commit messages to determine the type of changes in the codebase. Following formalized conventions for commit messages, semantic-release automatically determines the next semantic version number.

By default semantic-release uses Angular Commit Message Conventions.

Here is an example of the release type that will be done based on a commit messages:

Commit message Release type
fix(pencil): stop graphite breaking when too much pressure applied
Patch Release
feat(pencil): add 'graphiteWidth' option
Minor Release
perf(pencil): remove graphiteWidth option

BREAKING CHANGE: The graphiteWidth option has been removed.
The default graphite width of 10mm is always used for performance reasons.
Major Release

Adds a workflow file which can be run to create a semantic
tag and immediately afterwards, create a release on GitHub.

Any collaborator with write access should be able to
trigger the workflow.

This commit also adds another workflow file, which leaves a
comment after a PR has been merged. The comment reminds to
trigger the aforementioned release workflow.
@rebornplusplus rebornplusplus self-assigned this Jul 5, 2023
@SamirPS
Copy link

SamirPS commented Jul 5, 2023

Can the create release workflowbe launched automatically after we close PR?

@rebornplusplus
Copy link
Member Author

Can the create release workflowbe launched automatically after we close PR?

Yup, for sure, it can be. But I think we don't want to release versions after every PR merge. Some PRs may be insignificant, or sometimes irrelevant to contribute to a release.

Copy link
Collaborator

@cjdcordeiro cjdcordeiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks! Left a few comments. Do you have an example of this workflow's results?

.github/workflows/notify-pr-close.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Show resolved Hide resolved
.github/workflows/release.yml Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
@rebornplusplus
Copy link
Member Author

Do you have an example of this workflow's results?

You can check out the releases and workflow runs at https://github.com/rebornplusplus/rocks-toolbox. It may be a bit messy there, lots of experiment runs.

Additionally, I will outline the behaviour of the workflow for clarity:
image

Copy link
Collaborator

@cjdcordeiro cjdcordeiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the example and diagram. It's LGTM...just need to polish the last two comments and that should be it

@cjdcordeiro
Copy link
Collaborator

Great, thanks. merging

@cjdcordeiro cjdcordeiro merged commit 1b54b35 into canonical:main Jul 11, 2023
@rebornplusplus rebornplusplus deleted the ROCKS-706/auto-release branch October 14, 2024 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants