{"id":15623829,"url":"https://github.com/mrkmg/node-generate-release","last_synced_at":"2025-04-28T16:13:46.445Z","repository":{"id":57246275,"uuid":"50311829","full_name":"mrkmg/node-generate-release","owner":"mrkmg","description":"Generate a release for a project following semver using nodejs and gitflow","archived":false,"fork":false,"pushed_at":"2018-05-04T16:59:16.000Z","size":325,"stargazers_count":36,"open_issues_count":2,"forks_count":8,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-04-28T16:13:41.660Z","etag":null,"topics":["flow","git","git-flow","git-stream","node","nodejs","relase","semver"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/mrkmg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-24T22:38:20.000Z","updated_at":"2025-02-16T09:37:30.000Z","dependencies_parsed_at":"2022-08-24T16:31:41.708Z","dependency_job_id":null,"html_url":"https://github.com/mrkmg/node-generate-release","commit_stats":null,"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkmg%2Fnode-generate-release","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkmg%2Fnode-generate-release/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkmg%2Fnode-generate-release/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkmg%2Fnode-generate-release/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrkmg","download_url":"https://codeload.github.com/mrkmg/node-generate-release/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251342725,"owners_count":21574245,"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":["flow","git","git-flow","git-stream","node","nodejs","relase","semver"],"created_at":"2024-10-03T09:59:03.331Z","updated_at":"2025-04-28T16:13:46.425Z","avatar_url":"https://github.com/mrkmg.png","language":"TypeScript","readme":"# node-generate-release\nGenerate a release for a project following semver using nodejs and \n[gitflow](https://github.com/petervanderdoes/gitflow-avh) or \n[git-stream](https://github.com/mrkmg/git-stream)\n\n[![Generate Release on Travis CI](https://img.shields.io/travis/mrkmg/node-generate-release/master.svg?style=flat-square)](https://travis-ci.org/mrkmg/node-generate-release/branches)\n[![Coverage Status](https://img.shields.io/coveralls/mrkmg/node-generate-release/master.svg?style=flat-square)](https://coveralls.io/github/mrkmg/node-generate-release?branch=master)\n[![Generate Release on NPM](https://img.shields.io/npm/v/generate-release.svg?style=flat-square)](https://www.npmjs.com/package/generate-release)\n[![Generate Release uses the MIT](https://img.shields.io/npm/l/generate-release.svg?style=flat-square)](https://opensource.org/licenses/MIT)\n\nCurrent Version: 1.1.1\n\nRequires NodeJS v4.0.0 or greater\n\n![Generate Release Example](https://cloud.githubusercontent.com/assets/399561/16465518/272a62be-3e0d-11e6-8691-44441a3b0629.gif)\n\n\nUsage\n-----\n\nYou can either install `generate-release` globally or for a single project\n\n__Globally__\n\nInstall package\n\n    npm install -g generate-release\n\nNavigate to your project and execute `generate-release`\n\n__Locally__\n\n    cd your/project\n    npm install --save-dev generate-release\n    \nThen add the following to your `package.json` file:\n\n    {\n        \"scripts\": {\n            \"release\": \"generate-release\"\n        }\n    }\n\nThen you can run `npm run-script release` in order to generate a release.\n\n**Important notes for gitflow OSX**\n\nGit-flow from nvie is broken on OSX, and `generate-release` will not work. Please use the updated and actively \nmaintained version from petervanderdoes, \n[https://github.com/petervanderdoes/gitflow-avh](https://github.com/petervanderdoes/gitflow-avh). Please follow the \n[OSX Install Guide](https://github.com/petervanderdoes/gitflow-avh/wiki/Installing-on-Mac-OS-X)\n\nWhat does it do?\n----------------\n\nThis is the default process.\n\n1. Verify the working directory is clean\n1. Reads git-flow settings from repo config file\n1. Reads Current version from package.json file and generates the new version\n1. Fetches from `remote`\n1. Rebases `remote`/develop into develop\n1. Resets master to `remote`/master\n1. Starts a gitflow or git-stream release named the new version number\n1. Changes the version number in package.json and any files in `files_to_version`\n1. Runs all `pre_commit_commands`\n1. Commits the changes to the package.json and any file in `files_to_version` and `files_to_commit`\n    1. *This will also commit any file deletions which may have occurred during the `pre_commit_commands`*\n1. Runs all `post_commit_commands`\n1. Runs the gitflow or git-stream finish release command\n1. Pushes master, develop, and tags to `remote`\n1. Runs all the `post_complete_commands`\n\n*If any of the steps aside from the `post_complete_commands` step fail, the entire release is canceled and everything\nis reset.*\n\n*All commands are run in either `sh` or `cmd.exe`. If `sh` is available, even on windows, it will use that first.*\n\nOptions\n--------\n\n**CLI**\n\nrun `generate-release --help` to see this as well.\n\n    -p, --package   FILE            Path to package.json file. Default: ./package.json\n    -c, --current-version VERSION   Current Version. Default: read from package.json\n    -v, --next-version VERSION      Next Version. Default: automatically bumps\n    -t, --release-type TYPE         Release Type: patch, minor, major. Ignored when next-version is given. Default: prompt, if next-version is undefined\n    -n, --no-confirm                Do not ask for confirmation. Default: prompt for confirmation\n    -l, --skip-git-pull             Do not pull from origin and rebase master and dev. Default: Do pull\n    -s, --skip-git-push             Do not push to origin when complete. Default: Do push\n    -f, --skip-git-flow-finish,     Do not finish git-flow release. Default: Do finish\n        --skip-finish\n    -d, --release-file FILE         Path to your .release.json file. Default: ./.release.json\n    -o, --remote REMOTE             Change the remote. Default: origin\n    -q, --quiet                     Less output. Default: Do show output\n    -m, release-message [MESSAGE]   Set a release message. If no message given, prompt for one. Will replace\n                                    \"{version}\" with the next version. Default: Release {version}\n\n**Release File**\n\nBy default, the following options can be set in a `.release.json` file. The following\nis an example with all default options set.\n\n      {\n          \"package_file_location\": \"./package.json\",\n          \"no_confirm\": false,\n          \"skip_git_pull\": false,\n          \"skip_git_push\": false,\n          \"skip_finish\": false,\n          \"release_message\": true,\n          \"remote\": \"origin\",\n          \"pre_commit_commands\": [],\n          \"post_commit_commands\": [],\n          \"post_complete_commands\": [],\n          \"files_to_commit\": [],\n          \"files_to_version\": [\"README.md\"]\n      }\n      \nThe `files_to_commit` and `files_to_version` use [node-glob](https://github.com/isaacs/node-glob). See the\ndocumentation located there on how to format those options.\n\nIf `release_message` is true, then you will be prompted to write a release message via your editor of choice.\n\n**package.json**\n\nIf you are using this for an NPM package, you can include all the above options in your package.json instead of \na dedicated file.\n\nPlace all your configuration options in `config : generateRelease`.\n\n    {\n        ...\n        \"config\": {\n            \"generateRelease\": {\n                \"no_confirm\": false,\n                \"remote\": \"origin\"\n            }\n        },\n        ...\n    }\n\n**Option Precedence**\n\nPrecedence is determined in the following order:\n\n- CLI Argument\n- package.json file\n- .release.json file\n\nBuilding Assets, Running Tests, and Publishing Package\n--------------------------------\n\nIf you wish to build assets, run test, and/or publish your project automatically when the\nrelease is being generated you can use the example `.release.json` file below. The\nfollowing assumptions are made:\n\n- You have a script in your package file to build your assets named `build-assets`\n- All your built assets are saved to `./build`\n- You run your tests via the `npm test` command\n- You publish your package via the `npm publish` command\n\n.release.json\n\n    {\n        \"pre_commit_commands\": [\n            \"npm run-script build-assets\"\n        ],\n        \"post_commit_commands\": [\n            \"npm test\"\n        ],\n        \"post_complete_commands\": [\n            \"npm publish\"\n        ],\n        \"files_to_commit\": [\n            \"./build/**/*\"\n        ]\n    }\n\nUsage on a Non NPM Based Repo\n-----------------------------\n\nIt's quite simple to use this on a non NPM based repo. The only npm specific aspect baked into Generate Release is the\nusage of the package.json file. In fact, you are able to use any json file which maintains a version property. If you\nare working on a PHP project which uses [Composer](https://getcomposer.org), the composer.json already has the required\nproperty. Either call generate-release with `-p composer.json` or set the `package_file_location` property of your\n`.release.json` file.\n\nIf your project does not already contain a json file which maintains a version, you just use the `.release.json` \nfile! Just put a version property in the file and set `package_file_location` to \".release.json\".\n\n\nRoadmap\n-------\n\n- Write tests **Partial**\n- Code coverage for tests **Partial**\n- ~~Change remote (not origin)~~\n- ~~Allow for custom hook (like running gulp or grunt during release to prepare assets)~~\n- ~~Ability to define arbitrary files to replace version in (like source code files, other MD's, etc)~~\n- ~~Use and parse a .release file to parse defaults (instead of using cli switches)~~\n- ~~Custom release message~~\n- ~~Read git-flow configuration from .git folder~~\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrkmg%2Fnode-generate-release","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrkmg%2Fnode-generate-release","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrkmg%2Fnode-generate-release/lists"}