{"id":13432829,"url":"https://github.com/ungoldman/gh-release","last_synced_at":"2025-04-04T18:07:26.666Z","repository":{"id":27008389,"uuid":"30472513","full_name":"ungoldman/gh-release","owner":"ungoldman","description":"🚀 Create a GitHub Release for a Node package.","archived":false,"fork":false,"pushed_at":"2023-01-20T23:39:58.000Z","size":682,"stargazers_count":151,"open_issues_count":7,"forks_count":36,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-06-22T05:04:02.183Z","etag":null,"topics":["changelog","github","node","release","semver","tag"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ungoldman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-07T22:26:35.000Z","updated_at":"2024-05-21T14:36:12.000Z","dependencies_parsed_at":"2023-02-12T06:45:17.182Z","dependency_job_id":null,"html_url":"https://github.com/ungoldman/gh-release","commit_stats":null,"previous_names":["ngoldman/gh-release"],"tags_count":58,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ungoldman%2Fgh-release","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ungoldman%2Fgh-release/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ungoldman%2Fgh-release/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ungoldman%2Fgh-release/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ungoldman","download_url":"https://codeload.github.com/ungoldman/gh-release/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246899654,"owners_count":20851897,"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":["changelog","github","node","release","semver","tag"],"created_at":"2024-07-31T02:01:17.214Z","updated_at":"2025-04-04T18:07:26.645Z","avatar_url":"https://github.com/ungoldman.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003cdiv class=\"hero\" align=\"center\"\u003e\n\n\u003cimg src=\"./rocket.png\" width=\"120\" height=\"120\" alt=\"rocket\"\u003e\n\n# gh-release\n\nCreate a GitHub Release for a Node package.\n\n[![npm][npm-image]][npm-url]\n[![build][build-image]][build-url]\n[![downloads][downloads-image]][npm-url]\n\n[npm-image]: https://img.shields.io/npm/v/gh-release.svg\n[npm-url]: https://www.npmjs.com/package/gh-release\n[build-image]: https://github.com/ungoldman/gh-release/actions/workflows/tests.yml/badge.svg\n[build-url]: https://github.com/ungoldman/gh-release/actions/workflows/tests.yml\n[downloads-image]: https://img.shields.io/npm/dm/gh-release.svg\n\n\u003c/div\u003e\n\n## Features\n\n- Uses the [Github Releases API](https://developer.github.com/v3/repos/releases/) to create a new GitHub release.\n- Defaults to using information from `package.json` and `CHANGELOG.md`.\n- Supports uploading release assets.\n\n## Install\n\n```\n$ npm install gh-release\n```\n\n## Usage\n\n### Command-line interface\n\n```console\n$ gh-release\nYour GitHub username: ungoldman\nYour GitHub password: ✔✔✔✔✔✔✔✔\n\ncreating release v1.0.9 for ungoldman/gh-release-test\n\nname:               v1.0.9\ntag_name:           v1.0.9\ntarget_commitish:   3b06705e43be83363f063966f36ede3990a2842a\nendpoint:           https://api.github.com\nbody:\n\n### Maintenance\n* test: testing latest CLI output\n* deps: gh-release@6\n* pkg: set package to private\n* pkg: update repo URLS\n* misc: ignore package-lock.json\n\n? publish release to github? Yes\nhttps://github.com/ungoldman/gh-release-test/releases/tag/v1.0.9\n```\n\nShould be run at the root of the project to be released.\n\nExpects a `package.json` and `CHANGELOG.md` in the working directory.\n\nPrints release URL to `stdout` on success.\n\nUses [`ghauth`](https://github.com/rvagg/ghauth) for authentication with Github. A Github API OAuth token is saved to the `gh-release` config directory after the first time authenticating. Note that the config directory is determined by [`application-config`](https://github.com/LinusU/node-application-config) and is OS-specific. gh-release will alternatively use the token specified in the `GH_RELEASE_GITHUB_API_TOKEN` environment variable if it exists. This allows it to be used in continuous deployment systems, which can inject different GitHub API tokens depending on the location of the project.\n\nGet usage info by running with `--help` or `-h`.\n\n```console\n$ gh-release --help\nUsage: gh-release [options]\n\nExamples:\n  gh-release -n v2.0.3 -c master -d    create a draft release with title v2.0.3 tagged at HEAD of master\n\n\nOptions:\n  -t, --tag_name          tag for this release\n  -c, --target_commitish  commitish value for tag\n  -n, --name              text of release title\n  -b, --body              text of release body\n  -o, --owner             repo owner\n  -r, --repo              repo name\n  -d, --draft             publish as draft                          [default: false]\n  -p, --prerelease        publish as prerelease                     [default: false]\n  -w, --workpath          path to working directory                 [default: current directory]\n  -e, --endpoint          GitHub API endpoint URL                   [default: \"https://api.github.com\"]\n  -a, --assets            comma-delimited list of assets to upload  [default: false]\n  --dry-run               dry run (stops before release step)       [default: false]\n  -y, --yes               bypass confirmation prompt for release    [default: false]\n  -h, --help              Show help\n  -v, --version           Show version number\n```\n\n### Node API\n\n```js\nvar ghRelease = require('gh-release')\n\n// all options have defaults and can be omitted\nvar options = {\n  tag_name: 'v1.0.0',\n  target_commitish: 'master',\n  name: 'v1.0.0',\n  body: '* init\\n',\n  draft: false,\n  prerelease: false,\n  repo: 'gh-release',\n  owner: 'ungoldman',\n  endpoint: 'https://api.github.com' // for GitHub enterprise, use http(s)://hostname/api/v3\n}\n\n// options can also be just an empty object\nvar options = {}\n\n// auth is required\n// it can be an API token...\noptions.auth = {\n  token: 'XXXXXXXX'\n}\n\n// or it can either be a username \u0026 password\n// (But only for GitHub Enterprise when endpoint is set)\noptions.auth = {\n  username: 'ungoldman',\n  password: 'XXXXXXXX'\n}\n\nghRelease(options, function (err, result) {\n  if (err) throw err\n  console.log(result) // create release response: https://developer.github.com/v3/repos/releases/#response-4\n})\n```\n\n## Defaults\n\nAll default values taken from `package.json` unless specified otherwise.\n\n| name | description | default |\n| ---: | ----------- | ------- |\n| `tag_name` | release tag | 'v' + `version` |\n| `target_commitish` | commitish value to tag | HEAD of current branch |\n| `name` | release title | 'v' + `version` |\n| `body` | release text | `CHANGELOG.md` section matching `version` |\n| `owner` | repo owner | repo owner in `repository` |\n| `repo` | repo name | repo name in `repository` |\n| `draft` | publish as draft | false |\n| `prerelease` | publish as prerelease | false |\n| `assets` | release assets to upload | false |\n| `endpoint` | GitHub API endpoint URL | https://api.github.com |\n\nOverride defaults with flags (CLI) or the `options` object (node).\n\n## Standards\n\n* `CHANGELOG.md`: http://keepachangelog.com\n* `package.json`: https://docs.npmjs.com/files/package.json\n\n## Example\n\nAll [releases](https://github.com/ungoldman/gh-release/releases) of `gh-release` were created with `gh-release`.\n\n## Config location\n\nPlatform | Location\n--- | ---\nOS X | `~/Library/Application Support/gh-release/config.json`\nLinux (XDG) | `$XDG_CONFIG_HOME/gh-release/config.json`\nLinux (Legacy) | `~/.config/gh-release/config.json`\nWindows (\u003e Vista) | `%LOCALAPPDATA%/gh-release/config.json`\nWindows (XP, 2000) | `%USERPROFILE%/Local Settings/Application Data/gh-release/config.json`\n\n## Motivation\n\nThere are packages that already do something like this, and they're great, but I want something that does this one thing really well and nothing else, leans heavily on standards in `package.json` and `CHANGELOG.md`, and can work both as a CLI tool and programmatically in node.\n\n## Contributing\n\nContributions welcome! Please read the [contributing guidelines](CONTRIBUTING.md) first.\n\n**⚠️ Important Note ⚠️**\n\nThis library abides by the well-established and widely adopted changelog conventions set forth in http://keepachangelog.com.\n\nAny other conventions (autochangelog, standard-version, etc.) are not currently supported, and support will likely not be added for them in the future. This library is several years old and well into maintenance mode.\n\n## History\n\nPlease read the [change log](CHANGELOG.md) for a human-readable history of changes.\n\n## Tests\n\n`gh-release` uses [`standard`](https://standardjs.com) and [`tape`](https://github.com/substack/tape) for testing. You can run all tests with `npm test`.\n\n## See also\n\n- [gh-release-assets](https://github.com/ungoldman/gh-release-assets)\n- [maintenance-modules](https://github.com/maxogden/maintenance-modules)\n\n## License\n\n[ISC](LICENSE.md)\n\nRocket image is from [emojipedia](https://emojipedia.org/rocket/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fungoldman%2Fgh-release","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fungoldman%2Fgh-release","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fungoldman%2Fgh-release/lists"}