{"id":13486683,"url":"https://github.com/helm/chart-releaser","last_synced_at":"2025-05-14T05:10:43.208Z","repository":{"id":36321964,"uuid":"144605653","full_name":"helm/chart-releaser","owner":"helm","description":"Hosting Helm Charts via GitHub Pages and Releases","archived":false,"fork":false,"pushed_at":"2025-05-12T09:44:41.000Z","size":3160,"stargazers_count":739,"open_issues_count":46,"forks_count":116,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-05-12T10:43:37.413Z","etag":null,"topics":["charts","helm","hosting","kubernetes","repository"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/helm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","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":"2018-08-13T16:27:44.000Z","updated_at":"2025-05-12T09:44:44.000Z","dependencies_parsed_at":"2023-01-17T01:31:24.071Z","dependency_job_id":"6c2216c3-fd74-4a2e-bfa1-507538ac48e4","html_url":"https://github.com/helm/chart-releaser","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helm%2Fchart-releaser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helm%2Fchart-releaser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helm%2Fchart-releaser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helm%2Fchart-releaser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/helm","download_url":"https://codeload.github.com/helm/chart-releaser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076850,"owners_count":22010611,"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":["charts","helm","hosting","kubernetes","repository"],"created_at":"2024-07-31T18:00:49.885Z","updated_at":"2025-05-14T05:10:43.171Z","avatar_url":"https://github.com/helm.png","language":"Go","funding_links":[],"categories":["Go","kubernetes"],"sub_categories":[],"readme":"# Chart Releaser\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n![CI](https://github.com/helm/chart-releaser/workflows/CI/badge.svg?branch=main\u0026event=push)\n\n**Helps Turn GitHub Repositories into Helm Chart Repositories**\n\n`cr` is a tool designed to help GitHub repos self-host their own chart repos by adding Helm chart artifacts to GitHub Releases named for the chart version and then creating an `index.yaml` file for those releases that can be hosted on GitHub Pages (or elsewhere!).\n\n## Installation\n\n### Binaries (recommended)\n\nDownload your preferred asset from the [releases page](https://github.com/helm/chart-releaser/releases) and install manually.\n\n### Homebrew\n\n```console\n$ brew tap helm/tap\n$ brew install chart-releaser\n```\n\n### Go get (for contributing)\n\n```console\n// clone repo to some directory outside GOPATH\n\n$ git clone https://github.com/helm/chart-releaser\n$ cd chart-releaser\n$ go mod download\n$ go install ./...\n```\n\n### Docker (for Continuous Integration)\n\nDocker images are pushed to the [helmpack/chart-releaser](https://quay.io/repository/helmpack/chart-releaser?tab=tags) Quay container registry. The Docker image is built on top of Alpine and its default entry-point is `cr`. See the [Dockerfile](./Dockerfile) for more details.\n\n## Common Usage\n\nCurrently, `cr` can create GitHub Releases from a set of charts packaged up into a directory and create an `index.yaml` file for the chart repository from GitHub Releases.\n\n```console\n$ cr --help\nCreate Helm chart repositories on GitHub Pages by uploading Chart packages\nand Chart metadata to GitHub Releases and creating a suitable index file\n\nUsage:\n  cr [command]\n\nAvailable Commands:\n  completion  generate the autocompletion script for the specified shell\n  help        Help about any command\n  index       Update Helm repo index.yaml for the given GitHub repo\n  package     Package Helm charts\n  upload      Upload Helm chart packages to GitHub Releases\n  version     Print version information\n\nFlags:\n      --config string   Config file (default is $HOME/.cr.yaml)\n  -h, --help            help for cr\n\nUse \"cr [command] --help\" for more information about a command.\n```\n\n### Dealing with charts that have dependencies\n\nUnfortuntely the releaser-tool won't automatically add repositories for dependencies, and this needs to be added to your pipeline ([example](https://github.com/davidkarlsen/flyway-operator/blob/main/.github/workflows/chart-release.yaml#L31)), prior to running the releaser, like this:\n\n```yaml\n    - name: add repos\n        run: |\n          helm repo add bitnami https://charts.bitnami.com/bitnami\n          helm repo add bitnami-pre2022 https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami\n\n      - name: Run chart-releaser\n        uses: helm/chart-releaser-action@v1.6.0\n        with:\n          charts_dir: config/helm-chart\n        env:\n          CR_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\"\n```\n\n\n### Create GitHub Releases from Helm Chart Packages\n\nScans a path for Helm chart packages and creates releases in the specified GitHub repo uploading the packages.\n\n```console\n$ cr upload --help\nUpload Helm chart packages to GitHub Releases\n\nUsage:\n  cr upload [flags]\n\nFlags:\n  -c, --commit string                  Target commit for release\n      --generate-release-notes         Whether to automatically generate the name and body for this release. See https://docs.github.com/en/rest/releases/releases\n  -b, --git-base-url string            GitHub Base URL (only needed for private GitHub) (default \"https://api.github.com/\")\n  -r, --git-repo string                GitHub repository\n  -u, --git-upload-url string          GitHub Upload URL (only needed for private GitHub) (default \"https://uploads.github.com/\")\n  -h, --help                           help for upload\n  -o, --owner string                   GitHub username or organization\n  -p, --package-path string            Path to directory with chart packages (default \".cr-release-packages\")\n      --release-name-template string   Go template for computing release names, using chart metadata (default \"{{ .Name }}-{{ .Version }}\")\n      --release-notes-file string      Markdown file with chart release notes. If it is set to empty string, or the file is not found, the chart description will be used instead. The file is read from the chart package\n      --skip-existing                  Skip upload if release exists\n  -t, --token string                   GitHub Auth Token\n      --make-release-latest bool       Mark the created GitHub release as 'latest' (default \"true\")\n      --packages-with-index            Host the package files in the GitHub Pages branch\n\nGlobal Flags:\n      --config string   Config file (default is $HOME/.cr.yaml)\n```\n\n### Create the Repository Index from GitHub Releases\n\nOnce uploaded you can create an `index.yaml` file that can be hosted on GitHub Pages (or elsewhere).\n\n```console\n$ cr index --help\nUpdate a Helm chart repository index.yaml file based on a the\ngiven GitHub repository's releases.\n\nUsage:\n  cr index [flags]\n\nFlags:\n  -b, --git-base-url string            GitHub Base URL (only needed for private GitHub) (default \"https://api.github.com/\")\n  -r, --git-repo string                GitHub repository\n  -u, --git-upload-url string          GitHub Upload URL (only needed for private GitHub) (default \"https://uploads.github.com/\")\n  -h, --help                           help for index\n  -i, --index-path string              Path to index file (default \".cr-index/index.yaml\")\n  -o, --owner string                   GitHub username or organization\n  -p, --package-path string            Path to directory with chart packages (default \".cr-release-packages\")\n      --pages-branch string            The GitHub pages branch (default \"gh-pages\")\n      --pages-index-path string        The GitHub pages index path (default \"index.yaml\")\n      --pr                             Create a pull request for index.yaml against the GitHub Pages branch (must not be set if --push is set)\n      --push                           Push index.yaml to the GitHub Pages branch (must not be set if --pr is set)\n      --release-name-template string   Go template for computing release names, using chart metadata (default \"{{ .Name }}-{{ .Version }}\")\n      --remote string                  The Git remote used when creating a local worktree for the GitHub Pages branch (default \"origin\")\n  -t, --token string                   GitHub Auth Token (only needed for private repos)\n      --packages-with-index            Host the package files in the GitHub Pages branch\n\nGlobal Flags:\n      --config string   Config file (default is $HOME/.cr.yaml)\n```\n\n## Usage with a private repository\n\nWhen using this tool on a private repository, helm is unable to download the chart package files. When you give Helm your username and password it uses it to authenticate to the repository (the index file). The index file then tells Helm where to get the tarball. If the tarball is hosted in some other location (Github Releases in this case) then it would require a second authentication (which Helm does not support). The solution is to host the files in the same place as your index file and make the links relative paths so there is no need for the second authentication.\n\n[#123](https://github.com/helm/chart-releaser/pull/123) solve this by adding a `--packages-with-index` flag to the upload and index commands.\n\n### Prerequisites\n\nHave a Github token with the right permissions (SSO enabled for entreprise) and Github Pages configured.\n\n### Usage\n\nHere are the three commands you must run for a chart to end-up hosted in the root directory of your Github page and be accessible :\n\n```bash\ncr package \u003cchart\u003e\n```\n\n```bash\ncr upload --owner \u003cowner\u003e --git-repo \u003crepo_name\u003e --packages-with-index --token \u003ctoken\u003e --push --skip-existing\n```\n\nDon't forget the `--skip-existing` flag in the upload command to avoid getting a `422 Validation Failed` error.\n\n```bash\ncr index --owner \u003cowner\u003e --git-repo \u003crepo_name\u003e  --packages-with-index --index-path . --token \u003ctoken\u003e --push\n```\n\n### Example\n\nWith a **testChart** helm chart in the root of your repository :\n\n```bash\ncr package testChart/\n```\n\nYou will obtain the .tgz in the **./cr-release-pacakges**\n\n![repository](https://user-images.githubusercontent.com/116822264/227932604-50bf08d9-44bc-4170-b830-a2dccf1afdde.PNG)\n\nDo the two followng commands :\n\n```bash\ncr upload --owner \u003cowner\u003e --git-repo \u003crepo_name\u003e --packages-with-index --token \u003ctoken\u003e --push --skip-existing\n\ncr index --owner \u003cowner\u003e --git-repo \u003crepo_name\u003e  --packages-with-index --index-path . --token \u003ctoken\u003e --push\n```\n\nYou should obtain a release of your **chart** as well as the .tgz in the root of your **github-pages** branch.\n\n![github pages](https://user-images.githubusercontent.com/116822264/230021850-8d713d5d-426b-41ac-9ff4-c7e19de40e32.PNG)\n\nWith the `index.yaml` that references each chart and every different versions of those charts :\n\n![index](https://user-images.githubusercontent.com/116822264/230022176-ec57a8e7-ddb7-4318-a03d-032548421e21.PNG)\n\n## Configuration\n\n`cr` is a command-line application.\nAll command-line flags can also be set via environment variables or config file.\nEnvironment variables must be prefixed with `CR_`.\nUnderscores must be used instead of hyphens.\n\nCLI flags, environment variables, and a config file can be mixed.\nThe following order of precedence applies:\n\n1. CLI flags\n1. Environment variables\n1. Config file\n\n### Examples\n\nThe following example show various ways of configuring the same thing:\n\n#### CLI\n\n```bash\ncr upload --owner myaccount --git-repo helm-charts --package-path .deploy --token 123456789\n```\n\n#### Environment Variables\n\n```bash\nexport CR_OWNER=myaccount\nexport CR_GIT_REPO=helm-charts\nexport CR_PACKAGE_PATH=.deploy\nexport CR_TOKEN=\"123456789\"\nexport CR_GIT_BASE_URL=\"https://api.github.com/\"\nexport CR_GIT_UPLOAD_URL=\"https://uploads.github.com/\"\nexport CR_SKIP_EXISTING=true\n\ncr upload\n```\n\n#### Config File\n\n`config.yaml`:\n\n```yaml\nowner: myaccount\ngit-repo: helm-charts\npackage-path: .deploy\ntoken: 123456789\ngit-base-url: https://api.github.com/\ngit-upload-url: https://uploads.github.com/\n```\n\n#### Config Usage\n\n```bash\ncr upload --config config.yaml\n```\n\n`cr` supports any format [Viper](https://github.com/spf13/viper) can read, i.e. JSON, TOML, YAML, HCL, and Java properties files.\n\nNotice that if no config file is specified, `cr.yaml` (or any of the supported formats) is loaded from the current directory, `$HOME/.cr`, or `/etc/cr`, in that order, if found.\n\n#### Notes for Github Enterprise Users\n\nFor Github Enterprise, `chart-releaser` users need to set `git-base-url` and `git-upload-url` correctly, but the correct values are not always obvious to endusers.\n\nBy default they are often along these lines:\n\n```console\nhttps://ghe.example.com/api/v3/\nhttps://ghe.example.com/api/uploads/\n```\n\nIf you are trying to figure out what your `upload_url` is try to use a curl command like this:\n`curl -u username:token https://example.com/api/v3/repos/org/repo/releases`\nand then look for `upload_url`. You need the part of the URL that appears before `repos/` in the path.\n\n## Common Error Messages\n\nDuring the upload, you can get the following error :\n\n```bash\n422 Validation Failed [{Resource:Release Field:tag_name Code:already_exists Message:}]\n```\n\nYou can solve it by adding the `--skip-existing` flag to your command. More details can be found in [#101](https://github.com/helm/chart-releaser/issues/101#issuecomment-766410614) and in [#111](https://github.com/helm/chart-releaser/pull/111) that solved this.\n\n## Known Bug\n\nCurrently, if you set the upload URL incorrectly, let's say to something like `https://example.com/uploads/`, then `cr upload` will appear to work, but the release will not be complete. When everything is working there should be three assets in each release, but instead, there will only be two source code assets. The third asset is missing and is needed by Helm. This issue will become apparent when you run `cr index` and it always claims that nothing has changed, because it can't find the asset it expects for the release.\n\nIt appears like the [go-github Do call](https://github.com/google/go-github/blob/master/github/github.go#L520) does not catch the fact that the upload URL is incorrect and passes back the expected error. If the asset upload fails, it would be better if the release was rolled back (deleted) and an appropriate log message is displayed to the user.\n\nThe `cr index` command should also generate a warning when a release has no assets attached to it, to help people detect and troubleshoot this type of problem.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelm%2Fchart-releaser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelm%2Fchart-releaser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelm%2Fchart-releaser/lists"}