1.1.0 • Published 3 years ago
sample01 v1.1.0
Auto Git Versioning
link detail https://github.com/yaza-putu/release-it
Requirement
- NodeJs + NPM
How To Install
##Install globally and run from anywhere
sudo npm install --global release-it
Configure
- create .release-it.json on your project with template bellow
- create or update .gitignore
*.release-it.json
- create GITHUB_TOKEN https://github.com/settings/tokens (just checklist controll repo)
- create GITLAB_TOKEN https://gitlab.com/profile/personal_access_tokens (just checklist controll repo)
- create ~/.bash_profile and insert
export GITHUB_TOKEN="9a....."
//or
export GITLAB_TOKEN="9a....."
export token optional , you can use export manual on terminal before run release-it
Use release-it
- export GITHUB_TOKEN="9a....." or export GITLAB_TOKEN="9a....." (use on terminal if you not create on ~/.bash_profile) Token require if release : true
- git add .
- git commit -m "messages"
- release-it and follow the next intructions
Template .release-it.json For Github
{
"git": {
"changelog": "git log --pretty=format:\"* %s (%h)\" ${latestTag}...HEAD",
"requireCleanWorkingDir": true,
"requireBranch": false,
"requireUpstream": true,
"requireCommits": false,
"addUntrackedFiles": false,
"commit": true,
"commitMessage": "Release v${version}",
"commitArgs": [],
"tag": true,
"tagName": "v${version}",
"tagAnnotation": "Release v${version}",
"tagArgs": [],
"push": true,
"pushArgs": ["--follow-tags"],
"pushRepo": "https://github.com/repository/reponame.git"
},
"github": {
"release": true,
"releaseName": "v${version}",
"releaseNotes": null,
"preRelease": false,
"draft": false,
"tokenRef": "GITHUB_TOKEN",
"assets": null,
"host": null,
"timeout": 0,
"proxy": null
}
}
Template .release-it.json For Gitlab
{
"git": {
"changelog": "git log --pretty=format:\"* %s (%h)\" ${latestTag}...HEAD",
"requireCleanWorkingDir": true,
"requireBranch": false,
"requireUpstream": true,
"requireCommits": false,
"addUntrackedFiles": false,
"commit": true,
"commitMessage": "Release v${version}",
"commitArgs": [],
"tag": true,
"tagName": "v${version}",
"tagAnnotation": "Release v${version}",
"tagArgs": [],
"push": true,
"pushArgs": ["--follow-tags"],
"pushRepo": "https://gitlab.com/repository/reponame.git"
},
"gitlab": {
"release": true,
"releaseName": "v${version}",
"releaseNotes": null,
"tokenRef": "GITLAB_TOKEN",
"assets": null,
"origin": null
}
}
Informations
more template config https://github.com/yaza-putu/release-it/tree/master/conf
If you like with manual tag versioning https://gist.github.com/yaza-putu/4cd2403baa937fa22fbcbf51b8157aef
1.1.0
3 years ago