- This workflow applies to the current repository.
- The git CLI (
git) and the GitHub CLI (gh) are already installed. - All versions use Semantic Versioning convention.
-
Check for local repository changes
Make sure that there are no local changes to the git repository and that everything has been pushed with this command:
git status
If there are some uncommitted changes, abort the workflow.
-
Get remote repository's latest release
Retrieve the latest released version of the repository with this command:
PAGER= gh release list --json tagName,isLatest --jq '.[] | select(.isLatest)|.tagName' -
Get local project's version
Get the local
versionvalue from thepackage.jsonfile. -
Determine new version
If the local version is smaller or identical to the remote version, ask for the new release's type before proceeding: major, minor or patch. Based on the release type, determine the new release version (
RELEASE_VERSION) by following semantic versioning. -
Determine release title
Ask the user for the new release's title (
RELEASE_TITLE). -
Increase local project version
Update the
package.jsonfile with the new version. Commit and push the change. -
Create GitHub release
Create the GitHub release with this command (replace
RELEASE_VERSIONandRELEASE_TITLEwith the previously collected values):gh release create RELEASE_VERSION --title RELEASE_TITLE --generate-notes