{"id":20475156,"url":"https://github.com/muratgozel/node-releaser","last_synced_at":"2025-04-13T12:29:39.337Z","repository":{"id":62354845,"uuid":"404343917","full_name":"muratgozel/node-releaser","owner":"muratgozel","description":"Automated versioning and package publishing tool. Supports semver and calver. Extendible with plugins.","archived":false,"fork":false,"pushed_at":"2024-08-19T00:27:54.000Z","size":1450,"stargazers_count":13,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T03:35:10.600Z","etag":null,"topics":["calver","continuous-delivery","docker","github","gitlab","npm","publishing","semver","versioning"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muratgozel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":"muratgozel","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-09-08T12:43:40.000Z","updated_at":"2024-12-02T07:08:58.000Z","dependencies_parsed_at":"2024-06-21T05:48:19.631Z","dependency_job_id":"ac130949-d1ae-474e-a2b9-f357e02f18b9","html_url":"https://github.com/muratgozel/node-releaser","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Fnode-releaser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Fnode-releaser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Fnode-releaser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Fnode-releaser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muratgozel","download_url":"https://codeload.github.com/muratgozel/node-releaser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248713938,"owners_count":21149804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calver","continuous-delivery","docker","github","gitlab","npm","publishing","semver","versioning"],"created_at":"2024-11-15T15:14:50.527Z","updated_at":"2025-04-13T12:29:39.314Z","avatar_url":"https://github.com/muratgozel.png","language":"JavaScript","funding_links":["https://patreon.com/muratgozel","https://patreon.com/muratgozel?utm_medium=organic\u0026utm_source=github_repo\u0026utm_campaign=github\u0026utm_content=join_link"],"categories":[],"sub_categories":[],"readme":"# node-releaser\nSoftware versioning, releasing and publishing tool.\n\n![NPM](https://img.shields.io/npm/l/node-releaser)\n[![npm version](https://badge.fury.io/js/node-releaser.svg)](https://badge.fury.io/js/node-releaser)\n\n## Features\n1. Supports [semver](https://semver.org) and [calver](https://calver.org) based versioning.\n2. Auto-create Github/Gitlab releases.\n3. Auto-manage package.json's version field and optional npm publish option.\n4. Auto-publishes your docker containers as you release.\n5. Interactive cli with `--non-interactive` option.\n\n![Sample output of check command.](assets/releaser-check.gif)\n\n## Install\n```sh\n# install globally\nnpm i -g node-releaser\n# or locally\nnpm i node-releaser \n```\n\n## Use\n```sh\n# if you installed globally\nreleaser [command] [options]\n# or locally\nnpx releaser [command] [options]\n```\n\n## Quickstart\nIn any git based project, run:\n```sh\nreleaser release -l patch -m \"fixed something\" -m \"fixed something else\"\n```\nThis command validates your codebase first, runs interactive configuration wizard if there is no configuration defined, commit+tag+push your changes and calls relevant hooks while doing all of this.\n\n![Sample output of release command.](assets/releaser-release.gif)\n\nIt checks project's git history, git remotes, package.json and Dockerfile to offer you the essential functionality such as generating next versions, publishing npm package versions, creating releases on Github or Gitlab, pushing container images to a docker registry.\n\nAll features can be enabled/disabled through a configuration file. It is either `.releaser.json` or `releaser` property inside `package.json`. Interactive configuration wizard will help you to create this configuration and you can edit anytime as you wish.\n\nFor releasing on Github or Gitlab to work, the `GITHUB_TOKEN` or `GITLAB_TOKEN` environment variables has to be set. These are personal access tokens that you can create from their website.\n\n## Example Scenario: npm Packages\nLet's say you are making a node.js module to help devs in some way and you decided to host it on Github and serve via npm.\n\nOn initial release you would do:\n```sh\nreleaser release -l premajor.beta -m \"initial release.\"\n```\nThis command will show you the interactive configuration wizard and after configuration, it commits your changes, creates a git tag **v1.0.0-beta.0**, creates a release on Github and publishes your package on npm, in a default configuration behaviour.\n\nYou would do a few more beta updates and eventually release the major release:\n```sh\nreleaser release -l beta -m \"another beta release.\" # v1.0.0-beta.1\nreleaser release -l major -m \"major release!\" # v1.0.0\n```\n\n## Example Scenario: Frontend App\nIn this scenario, we are making frontend web application and want to use calendar versioning instead of semver. Our code hosted on Gitlab and we have a package.json.\n\nIn the first call for releaser, you will face the configuration wizard and this time we choose calver as versioning scheme instead of semver. The call is pretty much same with only `level` difference.\n```sh\nreleaser release -l calendar.beta -m \"initial release.\"\n```\nWith this call, our codebase will be pushed to Gitlab, version field of package.json gets updated, a new release will be created on Gitlab.\n\nYou can do more releases with no difference from previous examples:\n```sh\nreleaser release -l beta -m \"another beta release.\"\nreleaser release -l calendar -m \"major release!\"\n```\n\nSay you want to deploy as you release. You would have a deploy script such as `./cd/deploy.js` that triggers the deploy in the cloud and all you have to do is to add a releaser `afterPush` hook that executes that script after every successful release. In `.releaser.json` file add the following:\n\n```json\n{\n  \"hooks\": {\n    \"afterPush\": \"node ./cd/deploy.js\"\n  }\n}\n```\nWith this hook, on each release, releaser also execute the `node ./cd/deploy.js` command.\n\n## More Control With A Configuration File\nNormally, configuration managed by the releaser. But there could be cases that you want to edit configuration manually.\n\nReleaser configuration could be in `.releaser.json` or `releaser` property inside `package.json`.\n\nThis is the schema of the configuration:\n```json\n{\n  \"location\": {\"enum\": [\".releaser.json\", \"package.json\"], \"default\": \".releaser.json\"},\n  \"versioningScheme\": {\"enum\": [\"semver\", \"calver\"]},\n  \"versioningFormat\": {\"type\": \"string\", \"format\": \"calverFormat\"},\n  \"versioningPrefix\": {\"type\": \"string\", \"default\": \"\"},\n  \"npmUpdatePackageVersion\": {\"type\": \"boolean\", \"default\": false},\n  \"npmPublishPackage\": {\"type\": \"boolean\", \"default\": false},\n  \"npmPublishPackageArgs\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}, \"default\": []},\n  \"githubRelease\": {\"type\": \"boolean\", \"default\": false},\n  \"gitlabRelease\": {\"type\": \"boolean\", \"default\": false},\n  \"dockerConnectionString\": {\"type\": \"string\"},\n  \"dockerBuildPath\": {\"type\": \"string\", \"default\": \".\"},\n  \"dockerBuildArgs\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}, \"default\": []},\n  \"dockerPushArgs\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}, \"default\": []},\n  \"hooks\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"beforeCommit\": {\"type\": \"string\"},\n      \"afterCommit\": {\"type\": \"string\"},\n      \"beforePush\": {\"type\": \"string\"},\n      \"afterPush\": {\"type\": \"string\"}\n    }\n  }\n}\n```\nA simple typical configuration file looks like this:\n\n```json\n{\n  \"location\": \".releaser.json\",\n  \"versioningScheme\": \"semver\",\n  \"versioningPrefix\": \"v\",\n  \"npmUpdatePackageVersion\": true,\n  \"githubRelease\": true\n}\n```\n\n## Hooks\nThere are four hooks: `beforeCommit`, `afterCommit`, `beforePush` and `afterPush`. You can simply assign any command to any of these hooks via configuration file:\n```json\n{\n  \"hooks\": {\n    \"afterPush\": \"node ./cd/deploy.js\"\n  }\n}\n```\nAdditionally, there are template literals that you can pass as arguments to your commands:\n```json\n{\n  \"hooks\": {\n    \"afterPush\": \"node ./cd/deploy.js --version ${tag}\"\n  }\n}\n```\nOn execution the command above will become `node ./cd/deploy.js --version v1.2.3`.\n\nList of template literals:\n\n| Template Literal | Description                                      |\n|------------------|--------------------------------------------------|\n| gitRemote        | Push url read from git.                          |\n| gitRemoteService | It is \"github\" or \"gitlab\"                       |\n| gitBranch        | The name of the git branch such as \"main\"        |\n| tag              | Full version tag including prefix such as v1.2.3 |\n| abbrCommitHash   | Short version of the full commit hash.           |\n\n\nList of template literals based on the hook:\n\n| Hook         | Description                                                                                                    | Template Literals                                             |\n|--------------|----------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------|\n| beforeCommit | Executed just before committing.                                                                               | `gitRemote, gitRemoteService, gitBranch, tag`                 |\n| afterCommit  | Executed after committing and tagging.                                                                         | `gitRemote, gitRemoteService, gitBranch, tag, abbrCommitHash` |\n| beforePush   | Executed just before pushing to remote. (No difference with afterCommit but useful if you use `releaser push`) | `gitRemote, gitRemoteService, gitBranch, tag`                 |\n| afterPush    | Executed after pushing to remote.                                                                              | `gitRemote, gitRemoteService, gitBranch, tag`                 |\n\n\n## Command Line Interface\nYou can list all the commands and the options by adding `--help` to them.\n```sh\nreleaser --help\n```\n\n![Sample output of help command.](assets/releaser-help.gif)\n\n## Contributing\nIf you're interested in contributing, read the [CONTRIBUTING.md](https://github.com/muratgozel/muratgozel/blob/main/CONTRIBUTING.md) first, please.\n\n---\n\nVersion management of this repository done by [releaser](https://github.com/muratgozel/node-releaser) 🚀\n\n---\n\nThanks for watching 🐬\n\n[![Support me on Patreon](https://cdn.muratgozel.com.tr/support-me-on-patreon.v1.png)](https://patreon.com/muratgozel?utm_medium=organic\u0026utm_source=github_repo\u0026utm_campaign=github\u0026utm_content=join_link)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuratgozel%2Fnode-releaser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuratgozel%2Fnode-releaser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuratgozel%2Fnode-releaser/lists"}