{"id":13438391,"url":"https://github.com/tcnksm/ghr","last_synced_at":"2026-02-14T16:08:40.098Z","repository":{"id":18992045,"uuid":"22213849","full_name":"tcnksm/ghr","owner":"tcnksm","description":"Upload multiple artifacts to GitHub Release in parallel ","archived":false,"fork":false,"pushed_at":"2025-04-16T22:41:27.000Z","size":4778,"stargazers_count":1246,"open_issues_count":9,"forks_count":81,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-04-26T10:51:22.978Z","etag":null,"topics":["golang"],"latest_commit_sha":null,"homepage":"http://tcnksm.github.io/ghr/","language":"Go","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/tcnksm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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,"zenodo":null}},"created_at":"2014-07-24T13:29:22.000Z","updated_at":"2025-04-25T01:04:49.000Z","dependencies_parsed_at":"2024-06-18T11:22:02.530Z","dependency_job_id":"dba12494-6159-45d2-a2b1-e5f28f716257","html_url":"https://github.com/tcnksm/ghr","commit_stats":{"total_commits":330,"total_committers":43,"mean_commits":7.674418604651163,"dds":0.5242424242424242,"last_synced_commit":"f7dfff6686917eaa749c7a01660a82e55528df2f"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcnksm%2Fghr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcnksm%2Fghr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcnksm%2Fghr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcnksm%2Fghr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tcnksm","download_url":"https://codeload.github.com/tcnksm/ghr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251063784,"owners_count":21530845,"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":["golang"],"created_at":"2024-07-31T03:01:05.132Z","updated_at":"2026-02-14T16:08:40.093Z","avatar_url":"https://github.com/tcnksm.png","language":"Go","funding_links":[],"categories":["HarmonyOS","Go","golang"],"sub_categories":["Windows Manager"],"readme":"ghr\n====\n\n[![GitHub release](https://img.shields.io/github/release/tcnksm/ghr.svg?style=flat-square)][release]\n[![Test](https://github.com/tcnksm/ghr/actions/workflows/test.yml/badge.svg)][GitHub Actions]\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/tcnksm/ghr)][PkgGoDev]\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)][license]\n\n[release]: https://github.com/tcnksm/ghr/releases\n[GitHub Actions]: https://github.com/tcnksm/ghr/actions/workflows/test.yml\n[license]: https://github.com/tcnksm/ghr/blob/master/LICENSE\n[PkgGoDev]: https://pkg.go.dev/github.com/tcnksm/ghr\n\n`ghr` creates GitHub Release and uploads artifacts in parallel.\n\n## Demo\n\nThis demo creates GitHub Release page with `v1.0.0` tag and uploads cross-compiled golang binaries.\n\n![](doc/ghr.gif)\n\nYou can see release page [here](https://github.com/tcnksm/ghr-demo/releases/tag/v1.0.0).\n\n## Usage\n\nUsing `ghr` is simple. After setting GitHub API token (see more on [GitHub API Token](#github-api-token) section), change into your repository root directory and run the following command:\n\n```bash\n$ ghr [option] TAG [PATH]\n```\n\nYou must provide `TAG` (git tag) and optionally a `PATH` to artifacts you want to upload. You can specify a file or a directory. If you provide a directory, all files in that directory will be uploaded.\n\n`ghr` assumes that you are in a git repository when executed. This is because normally the artifacts you want to upload to a GitHub Release page are in that repository or generated there. With this assumption, `ghr` *implicitly* reads repository URL from `.git/config` file. But you can change this kind of information, see [Options](#options) section.\n\n### GitHub API Token\n\nTo use `ghr`, you need to get a GitHub token with an account which has enough permissions to create releases. To get a token, visit GitHub account settings page, then go to Applications for the user. Here you can create a token in the Personal access tokens section. For a private repository you need `repo` scope and for a public repository you need `public_repo` scope.\n\nWhen using `ghr`, you can set it via `GITHUB_TOKEN` env var, `-token` command line option or `github.token` property in `.gitconfig` file.\n\nFor instance, to set it via environment variable:\n\n```bash\n$ export GITHUB_TOKEN=\".....\"\n```\n\nOr set it in `github.token` in gitconfig:\n\n```bash\n$ git config --global github.token \".....\"\n```\n\nNote that environment variable take precedence over gitconfig value.\n\n### GitHub Enterprise\n\nYou can use `ghr` for GitHub Enterprise. Change API endpoint via the environment variable.\n\n```bash\n$ export GITHUB_API=http://github.company.com/api/v3/\n```\n\n## Example\n\nTo upload all files in `pkg/` directory with tag `v0.1.0`\n\n```bash\n$ ghr v0.1.0 pkg/\n--\u003e Uploading: pkg/0.1.0_SHASUMS\n--\u003e Uploading: pkg/ghr_0.1.0_darwin_386.zip\n--\u003e Uploading: pkg/ghr_0.1.0_darwin_amd64.zip\n--\u003e Uploading: pkg/ghr_0.1.0_linux_386.zip\n--\u003e Uploading: pkg/ghr_0.1.0_linux_amd64.zip\n--\u003e Uploading: pkg/ghr_0.1.0_windows_386.zip\n--\u003e Uploading: pkg/ghr_0.1.0_windows_amd64.zip\n```\n\n## Options\n\nYou can set some options:\n\n```bash\n$ ghr \\\n    -t TOKEN \\        # Set Github API Token\n    -u USERNAME \\     # Set Github username\n    -r REPO \\         # Set repository name\n    -c COMMIT \\       # Set target commitish, branch or commit SHA\n    -n TITLE \\        # Set release title\n    -b BODY \\         # Set text describing the contents of the release\n    -p NUM \\          # Set amount of parallelism (Default is number of CPU)\n    -delete \\         # Delete release and its git tag in advance if it exists (same as -recreate)\n    -replace \\        # Replace artifacts if it is already uploaded\n    -draft \\          # Release as draft (Unpublish)\n    -soft \\           # Stop uploading if the same tag already exists\n    -prerelease \\     # Create prerelease\n    -generatenotes \\  # Generate Release Notes automatically (See below)\n    TAG PATH\n```\n\n## Install\n\nIf you are a macOS user, you can use [Homebrew](https://brew.sh/):\n\n```bash\n$ brew install ghr\n```\n\nIf you are on another platform, you can download a binary from our [release page](https://github.com/tcnksm/ghr/releases) and place it in `$PATH` directory.\n\nOr you can use `go install`.\n\n```bash\n$ go install github.com/tcnksm/ghr@latest\n```\n\n## GitHub Actions\n\nYou can use `ghr` as a GitHub Action in your workflows. This action downloads and runs `ghr` to create a GitHub Release and upload artifacts.\n\n### Basic Usage\n\n```yaml\n- uses: tcnksm/ghr@v0\n  with:\n    tag: ${{ github.ref_name }}\n    path: dist/\n```\n\n### Inputs\n\n| Name | Description | Required | Default |\n|------|-------------|----------|---------|\n| `version` | Version of ghr to install | No | `v0.17.2` |\n| `tag` | Git tag for the release | **Yes** | |\n| `path` | Path to artifacts to upload (file or directory) | No | `.` |\n| `commitish` | Target commitish, branch or commit SHA | No | |\n| `name` | GitHub release title | No | |\n| `body` | Text describing the contents of the release | No | |\n| `draft` | Create release as draft | No | `false` |\n| `prerelease` | Create as prerelease | No | `false` |\n| `latest` | Set the release as latest (`true`, `false`, or `auto`) | No | |\n| `replace` | Replace artifacts if already uploaded | No | `false` |\n| `delete` | Recreate release if it already exists | No | `false` |\n| `soft` | Stop uploading if the tag already exists | No | `false` |\n| `generatenotes` | Generate release notes automatically | No | `false` |\n| `parallel` | Parallelization factor for uploads | No | |\n| `owner` | GitHub repository owner | No | |\n| `repository` | GitHub repository name | No | |\n| `token` | GitHub token for authentication | No | `${{ github.token }}` |\n\n### Example: Cross-compiled Release\n\n```yaml\nname: Release\non:\n  push:\n    tags:\n      - \"v*\"\njobs:\n  release:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: write\n    steps:\n      - uses: actions/checkout@v4\n      - uses: actions/setup-go@v5\n        with:\n          go-version-file: go.mod\n      - name: Build\n        run: make crossbuild\n      - uses: tcnksm/ghr@v0\n        with:\n          tag: ${{ github.ref_name }}\n          path: dist/\n          replace: \"true\"\n```\n\n## VS.\n\n- [aktau/github-release](https://github.com/aktau/github-release) - `github-release` can also create and edit releases and upload artifacts. It has many options. `ghr` is a simple alternative. And `ghr` will parallelize upload artifacts.\n\n## Generate Release Notes\n\nGitHub added the ability to automatically generate the body of a Release based on a format specified in\n`.github/release.yml` in Oct 2021. You can read more about that format [here](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes).\nghr now has the `-generatenotes` flag to enable that content to be programmatically added instead of manually supplying the body.\n\n## Contribution\n\n1. Fork ([https://github.com/tcnksm/ghr/fork](https://github.com/tcnksm/ghr/fork))\n2. Create a feature branch\n3. Commit your changes\n4. Rebase your local changes against the master branch\n5. Run test suite with the `make test` command and confirm that it passes using correct variables e.g. `GITHUB_TOKEN=$GITHUB_TOKEN TEST_REPO_OWNER=tcnksm TEST_REPO_NAME=ghr make test`\n6. Run `gofmt -s -w .`\n7. Create new Pull Request\n\n## Author\n\n[Taichi Nakashima](https://github.com/tcnksm)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcnksm%2Fghr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftcnksm%2Fghr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcnksm%2Fghr/lists"}