├── .gitignore ├── CODE_OF_CONDUCT.md ├── .github ├── dependabot.yml └── workflows │ └── test-action.yml ├── README.md ├── action.yml ├── cr.sh └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml 3 | 4 | node_modules/ 5 | lib/ 6 | 7 | logs/ 8 | *.log* 9 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Community Code of Conduct 2 | 3 | Helm follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). 4 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Copyright The Helm Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: 2 16 | updates: 17 | - package-ecosystem: "github-actions" 18 | directory: "/" 19 | schedule: 20 | interval: "daily" 21 | open-pull-requests-limit: 10 22 | groups: 23 | actions: 24 | update-types: 25 | - "minor" 26 | - "patch" 27 | -------------------------------------------------------------------------------- /.github/workflows/test-action.yml: -------------------------------------------------------------------------------- 1 | name: test-chart-releaser 2 | 3 | on: 4 | pull_request: 5 | 6 | permissions: {} 7 | 8 | jobs: 9 | 10 | test_chart_releaser_install_action: 11 | runs-on: ubuntu-latest 12 | 13 | permissions: 14 | contents: read 15 | 16 | name: Install chart-releaser and test presence in path 17 | steps: 18 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 19 | - name: Install chart-releaser 20 | uses: ./ 21 | with: 22 | install_only: true 23 | env: 24 | CR_TOKEN: "FAKE_SECRETS" 25 | - name: Check install! 26 | run: | 27 | cr version 28 | CR_VERSION_OUTPUT=$(cr version 2>&1 /dev/null) 29 | ACTUAL_VERSION=$(echo "$CR_VERSION_OUTPUT" | grep GitVersion | rev | cut -d ' ' -f1 | rev) 30 | if [[ $ACTUAL_VERSION != 'v1.7.0' ]]; then 31 | echo 'should be v1.7.0' 32 | exit 1 33 | else 34 | exit 0 35 | fi 36 | shell: bash 37 | - name: Check root directory 38 | run: | 39 | if ! git diff --stat --exit-code; then 40 | echo 'should be clean' 41 | exit 1 42 | fi 43 | 44 | test_chart_releaser_action: 45 | runs-on: ubuntu-latest 46 | 47 | permissions: 48 | contents: read 49 | 50 | name: Install chart-releaser and run it 51 | steps: 52 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 53 | - name: Install chart-releaser 54 | uses: ./ 55 | env: 56 | CR_TOKEN: "FAKE_SECRETS" 57 | - name: Check root directory 58 | run: | 59 | if ! git diff --stat --exit-code; then 60 | echo 'should be clean' 61 | exit 1 62 | fi 63 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # _chart-releaser_ Action 2 | 3 | A GitHub action to turn a GitHub project into a self-hosted Helm chart repo, using [helm/chart-releaser](https://github.com/helm/chart-releaser) CLI tool. 4 | 5 | ## Usage 6 | 7 | ### Pre-requisites 8 | 9 | 1. A GitHub repo containing a directory with your Helm charts (default is a folder named `/charts`, if you want to 10 | maintain your charts in a different directory, you must include a `charts_dir` input in the workflow). 11 | 1. A GitHub branch called `gh-pages` to store the published charts. 12 | 1. In your repo, go to Settings/Pages. Change the `Source` `Branch` to `gh-pages`. 13 | 1. Create a workflow `.yml` file in your `.github/workflows` directory. An [example workflow](#example-workflow) is available below. 14 | For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file) 15 | 16 | ### Inputs 17 | 18 | - `version`: The chart-releaser version to use (default: v1.7.0) 19 | - `config`: Optional config file for chart-releaser. For more information on the config file, see the [documentation](https://github.com/helm/chart-releaser#config-file) 20 | - `charts_dir`: The charts directory 21 | - `skip_packaging`: This option, when populated, will skip the packaging step. This allows you to do more advanced packaging of your charts (for example, with the `helm package` command) before this action runs. This action will only handle the indexing and publishing steps. 22 | - `skip_existing`: Skip package upload if release/tag already exists 23 | - `skip_upload`: This option, when populated, will skip the upload step. This allows you to do more advanced uploading of your charts (for exemple with OCI based repositories) which doen't require the `index.yaml`. 24 | - `mark_as_latest`: When you set this to `false`, it will mark the created GitHub release not as 'latest'. 25 | - `packages_with_index`: When you set this to `true`, it will upload chart packages directly into publishing branch. 26 | - `pages_branch`: Name of the branch to be used to push the index and artifacts. (default to: gh-pages but it is not set in the action it is a default value for the chart-releaser binary) 27 | 28 | ### Outputs 29 | 30 | - `changed_charts`: A comma-separated list of charts that were released on this run. Will be an empty string if no updates were detected, will be unset if `--skip_packaging` is used: in the latter case your custom packaging step is responsible for setting its own outputs if you need them. 31 | - `chart_version`: The version of the most recently generated charts; will be set even if no charts have been updated since the last run. 32 | 33 | ### Environment variables 34 | 35 | - `CR_TOKEN` (required): The GitHub token of this repository (`${{ secrets.GITHUB_TOKEN }}`) 36 | 37 | For more information on environment variables, see the [documentation](https://github.com/helm/chart-releaser#environment-variables). 38 | 39 | ### Example Workflow 40 | 41 | Create a workflow (eg: `.github/workflows/release.yml`): 42 | 43 | ```yaml 44 | name: Release Charts 45 | 46 | on: 47 | push: 48 | branches: 49 | - main 50 | 51 | jobs: 52 | release: 53 | # depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions 54 | # see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token 55 | permissions: 56 | contents: write 57 | runs-on: ubuntu-latest 58 | steps: 59 | - name: Checkout 60 | uses: actions/checkout@v4 61 | with: 62 | fetch-depth: 0 63 | 64 | - name: Configure Git 65 | run: | 66 | git config user.name "$GITHUB_ACTOR" 67 | git config user.email "$GITHUB_ACTOR@users.noreply.github.com" 68 | 69 | - name: Run chart-releaser 70 | uses: helm/chart-releaser-action@v1.7.0 71 | env: 72 | CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" 73 | ``` 74 | 75 | This uses [@helm/chart-releaser-action](https://www.github.com/helm/chart-releaser-action) to turn your GitHub project into a self-hosted Helm chart repo. 76 | It does this – during every push to `main` – by checking each chart in your project, and whenever there's a new chart version, creates a corresponding [GitHub release](https://help.github.com/en/github/administering-a-repository/about-releases) named for the chart version, adds Helm chart artifacts to the release, and creates or updates an `index.yaml` file with metadata about those releases, which is then hosted on GitHub Pages. You do not need an `index.yaml` file in `main` at all because it is managed in the `gh-pages` branch. 77 | 78 | #### Example using custom config 79 | 80 | `workflow.yml`: 81 | 82 | ```yaml 83 | - name: Run chart-releaser 84 | uses: helm/chart-releaser-action@v1.7.0 85 | with: 86 | charts_dir: charts 87 | config: cr.yaml 88 | env: 89 | CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" 90 | ``` 91 | 92 | `cr.yaml`: 93 | 94 | ```yaml 95 | owner: myaccount 96 | git-base-url: https://api.github.com/ 97 | ``` 98 | 99 | For options see [config-file](https://github.com/helm/chart-releaser#config-file). 100 | 101 | ## Code of conduct 102 | 103 | Participation in the Helm community is governed by the [Code of Conduct](CODE_OF_CONDUCT.md). 104 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | # Copyright The Helm Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | name: "Helm Chart Releaser" 16 | description: "Host a Helm charts repo on GitHub Pages" 17 | author: "The Helm authors" 18 | branding: 19 | color: blue 20 | icon: anchor 21 | inputs: 22 | version: 23 | description: "The chart-releaser version to use (default: v1.7.0)" 24 | required: false 25 | default: v1.7.0 26 | config: 27 | description: "The relative path to the chart-releaser config file" 28 | required: false 29 | charts_dir: 30 | description: The charts directory 31 | required: false 32 | default: charts 33 | install_dir: 34 | description: "Where to install the cr tool" 35 | required: false 36 | install_only: 37 | description: "Just install cr tool" 38 | required: false 39 | skip_packaging: 40 | description: "Skip the packaging option (do your custom packaging before running this action)" 41 | required: false 42 | skip_existing: 43 | description: "Skip package upload if release exists" 44 | required: false 45 | skip_upload: 46 | description: "Skip package upload" 47 | required: false 48 | mark_as_latest: 49 | description: Mark the created GitHub release as 'latest' 50 | required: false 51 | default: true 52 | packages_with_index: 53 | description: "Upload chart packages directly into publishing branch" 54 | required: false 55 | default: false 56 | pages_branch: 57 | description: "Name of the branch to be used to push the index and artifacts. (default to: gh-pages but it is not set in the action it is a default value for the chart-releaser binary)" 58 | required: false 59 | outputs: 60 | changed_charts: 61 | description: "A comma-separated list of charts that were released on this run. Will be an empty string if no updates were detected, will be unset if `--skip_packaging` is used: in the latter case your custom packaging step is responsible for setting its own outputs if you need them." 62 | value: ${{ steps.release.outputs.changed_charts }} 63 | chart_version: 64 | description: "The version of the most recently generated charts; will be set even if no charts have been updated since the last run." 65 | value: ${{ steps.release.outputs.chart_version }} 66 | 67 | runs: 68 | using: composite 69 | steps: 70 | - id: release 71 | run: | 72 | owner=$(cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY") 73 | repo=$(cut -d '/' -f 2 <<< "$GITHUB_REPOSITORY") 74 | 75 | args=(--owner "$owner" --repo "$repo") 76 | args+=(--charts-dir "${{ inputs.charts_dir }}") 77 | 78 | if [[ -n "${{ inputs.version }}" ]]; then 79 | args+=(--version "${{ inputs.version }}") 80 | fi 81 | 82 | if [[ -n "${{ inputs.config }}" ]]; then 83 | args+=(--config "${{ inputs.config }}") 84 | fi 85 | 86 | if [[ -z "${{ inputs.install_dir }}" ]]; then 87 | install="$RUNNER_TOOL_CACHE/cr/${{ inputs.version }}/$(uname -m)" 88 | echo "$install" >> "$GITHUB_PATH" 89 | args+=(--install-dir "$install") 90 | else 91 | echo ${{ inputs.install_dir }} >> "$GITHUB_PATH" 92 | args+=(--install-dir "${{ inputs.install_dir }}") 93 | fi 94 | 95 | if [[ -n "${{ inputs.install_only }}" ]]; then 96 | args+=(--install-only "${{ inputs.install_only }}") 97 | fi 98 | 99 | if [[ -n "${{ inputs.skip_packaging }}" ]]; then 100 | args+=(--skip-packaging "${{ inputs.skip_packaging }}") 101 | fi 102 | 103 | if [[ -n "${{ inputs.skip_existing }}" ]]; then 104 | args+=(--skip-existing "${{ inputs.skip_existing }}") 105 | fi 106 | 107 | if [[ -n "${{ inputs.skip_upload }}" ]]; then 108 | args+=(--skip-upload "${{ inputs.skip_upload }}") 109 | fi 110 | 111 | if [[ -n "${{ inputs.mark_as_latest }}" ]]; then 112 | args+=(--mark-as-latest "${{ inputs.mark_as_latest }}") 113 | fi 114 | 115 | if [[ -n "${{ inputs.packages_with_index }}" ]]; then 116 | args+=(--packages-with-index "${{ inputs.packages_with_index }}") 117 | fi 118 | 119 | if [[ -n "${{ inputs.pages_branch }}" ]]; then 120 | args+=(--pages-branch "${{ inputs.pages_branch }}") 121 | fi 122 | 123 | if [ "${{ runner.arch }}" == "ARM64" ]; then 124 | args+=(--use-arm "true") 125 | fi 126 | "$GITHUB_ACTION_PATH/cr.sh" "${args[@]}" 127 | 128 | if [[ -f changed_charts.txt ]]; then 129 | cat changed_charts.txt >> "$GITHUB_OUTPUT" 130 | fi 131 | if [[ -f chart_version.txt ]]; then 132 | cat chart_version.txt >> "$GITHUB_OUTPUT" 133 | fi 134 | rm -f changed_charts.txt chart_version.txt 135 | shell: bash 136 | -------------------------------------------------------------------------------- /cr.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright The Helm Authors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | set -o errexit 18 | set -o nounset 19 | set -o pipefail 20 | 21 | DEFAULT_CHART_RELEASER_VERSION=v1.7.0 22 | 23 | show_help() { 24 | cat < 26 | 27 | -h, --help Display help 28 | -v, --version The chart-releaser version to use (default: $DEFAULT_CHART_RELEASER_VERSION)" 29 | --config The path to the chart-releaser config file 30 | -d, --charts-dir The charts directory (default: charts) 31 | -o, --owner The repo owner 32 | -r, --repo The repo name 33 | --pages-branch The repo pages branch 34 | -n, --install-dir The Path to install the cr tool 35 | -i, --install-only Just install the cr tool 36 | -s, --skip-packaging Skip the packaging step (run your own packaging before using the releaser) 37 | --skip-existing Skip package upload if release exists 38 | --skip-upload Skip package upload, just create the release. Not needed in case of OCI upload. 39 | -l, --mark-as-latest Mark the created GitHub release as 'latest' (default: true) 40 | --packages-with-index Upload chart packages directly into publishing branch 41 | --use-arm Use ARM64 binary (default: false) 42 | EOF 43 | } 44 | 45 | main() { 46 | local version="$DEFAULT_CHART_RELEASER_VERSION" 47 | local config= 48 | local charts_dir=charts 49 | local owner= 50 | local repo= 51 | local install_dir= 52 | local install_only= 53 | local skip_packaging= 54 | local skip_existing= 55 | local skip_upload= 56 | local mark_as_latest=true 57 | local packages_with_index=false 58 | local pages_branch= 59 | local use_arm=false 60 | 61 | parse_command_line "$@" 62 | 63 | : "${CR_TOKEN:?Environment variable CR_TOKEN must be set}" 64 | 65 | local repo_root 66 | repo_root=$(git rev-parse --show-toplevel) 67 | pushd "$repo_root" >/dev/null 68 | 69 | if [[ -z "$skip_packaging" ]]; then 70 | echo 'Looking up latest tag...' 71 | local latest_tag 72 | latest_tag=$(lookup_latest_tag) 73 | 74 | echo "Discovering changed charts since '$latest_tag'..." 75 | local changed_charts=() 76 | readarray -t changed_charts <<<"$(lookup_changed_charts "$latest_tag")" 77 | 78 | if [[ -n "${changed_charts[*]}" ]]; then 79 | install_chart_releaser 80 | 81 | rm -rf .cr-release-packages 82 | mkdir -p .cr-release-packages 83 | 84 | rm -rf .cr-index 85 | mkdir -p .cr-index 86 | 87 | for chart in "${changed_charts[@]}"; do 88 | if [[ -d "$chart" ]]; then 89 | package_chart "$chart" 90 | else 91 | echo "Nothing to do. No chart changes detected." 92 | fi 93 | done 94 | 95 | release_charts 96 | update_index 97 | echo "changed_charts=$( 98 | IFS=, 99 | echo "${changed_charts[*]}" 100 | )" >changed_charts.txt 101 | 102 | echo "chart_version=${latest_tag}" >chart_version.txt 103 | else 104 | echo "Nothing to do. No chart changes detected." 105 | echo "changed_charts=" >changed_charts.txt 106 | echo "chart_version=" >chart_version.txt 107 | fi 108 | else 109 | install_chart_releaser 110 | rm -rf .cr-index 111 | mkdir -p .cr-index 112 | release_charts 113 | update_index 114 | fi 115 | 116 | popd >/dev/null 117 | } 118 | 119 | parse_command_line() { 120 | while :; do 121 | case "${1:-}" in 122 | -h | --help) 123 | show_help 124 | exit 125 | ;; 126 | --config) 127 | if [[ -n "${2:-}" ]]; then 128 | config="$2" 129 | shift 130 | else 131 | echo "ERROR: '--config' cannot be empty." >&2 132 | show_help 133 | exit 1 134 | fi 135 | ;; 136 | -v | --version) 137 | if [[ -n "${2:-}" ]]; then 138 | version="$2" 139 | shift 140 | else 141 | echo "ERROR: '-v|--version' cannot be empty." >&2 142 | show_help 143 | exit 1 144 | fi 145 | ;; 146 | -d | --charts-dir) 147 | if [[ -n "${2:-}" ]]; then 148 | charts_dir="$2" 149 | shift 150 | else 151 | echo "ERROR: '-d|--charts-dir' cannot be empty." >&2 152 | show_help 153 | exit 1 154 | fi 155 | ;; 156 | -o | --owner) 157 | if [[ -n "${2:-}" ]]; then 158 | owner="$2" 159 | shift 160 | else 161 | echo "ERROR: '--owner' cannot be empty." >&2 162 | show_help 163 | exit 1 164 | fi 165 | ;; 166 | -r | --repo) 167 | if [[ -n "${2:-}" ]]; then 168 | repo="$2" 169 | shift 170 | else 171 | echo "ERROR: '--repo' cannot be empty." >&2 172 | show_help 173 | exit 1 174 | fi 175 | ;; 176 | --pages-branch) 177 | if [[ -n "${2:-}" ]]; then 178 | pages_branch="$2" 179 | shift 180 | fi 181 | ;; 182 | -n | --install-dir) 183 | if [[ -n "${2:-}" ]]; then 184 | install_dir="$2" 185 | shift 186 | fi 187 | ;; 188 | -i | --install-only) 189 | if [[ -n "${2:-}" ]]; then 190 | install_only="$2" 191 | shift 192 | fi 193 | ;; 194 | -s | --skip-packaging) 195 | if [[ -n "${2:-}" ]]; then 196 | skip_packaging="$2" 197 | shift 198 | fi 199 | ;; 200 | --skip-existing) 201 | if [[ -n "${2:-}" ]]; then 202 | skip_existing="$2" 203 | shift 204 | fi 205 | ;; 206 | --skip-upload) 207 | if [[ -n "${2:-}" ]]; then 208 | skip_upload="$2" 209 | shift 210 | fi 211 | ;; 212 | -l | --mark-as-latest) 213 | if [[ -n "${2:-}" ]]; then 214 | mark_as_latest="$2" 215 | shift 216 | fi 217 | ;; 218 | --packages-with-index) 219 | if [[ -n "${2:-}" ]]; then 220 | packages_with_index="$2" 221 | shift 222 | fi 223 | ;; 224 | --use-arm) 225 | if [[ -n "${2:-}" ]]; then 226 | use_arm="$2" 227 | shift 228 | fi 229 | ;; 230 | *) 231 | break 232 | ;; 233 | esac 234 | 235 | shift 236 | done 237 | 238 | if [[ -z "$owner" ]]; then 239 | echo "ERROR: '-o|--owner' is required." >&2 240 | show_help 241 | exit 1 242 | fi 243 | 244 | if [[ -z "$repo" ]]; then 245 | echo "ERROR: '-r|--repo' is required." >&2 246 | show_help 247 | exit 1 248 | fi 249 | 250 | if [[ -z "$install_dir" ]]; then 251 | local arch 252 | arch=$(uname -m) 253 | install_dir="$RUNNER_TOOL_CACHE/cr/$version/$arch" 254 | fi 255 | 256 | if [[ -n "$install_only" ]]; then 257 | echo "Will install cr tool and not run it..." 258 | install_chart_releaser 259 | exit 0 260 | fi 261 | } 262 | 263 | install_chart_releaser() { 264 | if [[ ! -d "$RUNNER_TOOL_CACHE" ]]; then 265 | echo "Cache directory '$RUNNER_TOOL_CACHE' does not exist" >&2 266 | exit 1 267 | fi 268 | 269 | if [[ ! -d "$install_dir" ]]; then 270 | mkdir -p "$install_dir" 271 | architecture=linux_amd64 272 | if [[ "$use_arm" = true ]]; then 273 | architecture=linux_arm64 274 | fi 275 | echo "Installing chart-releaser on $install_dir..." 276 | curl -sSLo cr.tar.gz "https://github.com/helm/chart-releaser/releases/download/$version/chart-releaser_${version#v}_${architecture}.tar.gz" 277 | tar -xzf cr.tar.gz -C "$install_dir" 278 | rm -f cr.tar.gz 279 | fi 280 | 281 | echo 'Adding cr directory to PATH...' 282 | export PATH="$install_dir:$PATH" 283 | } 284 | 285 | lookup_latest_tag() { 286 | git fetch --tags >/dev/null 2>&1 287 | 288 | if ! git describe --tags --abbrev=0 HEAD~ 2>/dev/null; then 289 | git rev-list --max-parents=0 --first-parent HEAD 290 | fi 291 | } 292 | 293 | filter_charts() { 294 | while read -r chart; do 295 | [[ ! -d "$chart" ]] && continue 296 | local file="$chart/Chart.yaml" 297 | if [[ -f "$file" ]]; then 298 | echo "$chart" 299 | else 300 | echo "WARNING: $file is missing, assuming that '$chart' is not a Helm chart. Skipping." 1>&2 301 | fi 302 | done 303 | } 304 | 305 | lookup_changed_charts() { 306 | local commit="$1" 307 | 308 | local changed_files 309 | changed_files=$(git diff --find-renames --name-only "$commit" -- "$charts_dir") 310 | 311 | local depth=$(($(tr "/" "\n" <<<"$charts_dir" | sed '/^\(\.\)*$/d' | wc -l) + 1)) 312 | local fields="1-${depth}" 313 | 314 | cut -d '/' -f "$fields" <<<"$changed_files" | uniq | filter_charts 315 | } 316 | 317 | package_chart() { 318 | local chart="$1" 319 | 320 | local args=("$chart" --package-path .cr-release-packages) 321 | if [[ -n "$config" ]]; then 322 | args+=(--config "$config") 323 | fi 324 | 325 | echo "Packaging chart '$chart'..." 326 | cr package "${args[@]}" 327 | } 328 | 329 | release_charts() { 330 | local args=(-o "$owner" -r "$repo" -c "$(git rev-parse HEAD)") 331 | if [[ -n "$config" ]]; then 332 | args+=(--config "$config") 333 | fi 334 | if [[ "$packages_with_index" = true ]]; then 335 | args+=(--packages-with-index --push --skip-existing) 336 | elif [[ -n "$skip_existing" ]]; then 337 | args+=(--skip-existing) 338 | fi 339 | if [[ "$mark_as_latest" = false ]]; then 340 | args+=(--make-release-latest=false) 341 | fi 342 | if [[ -n "$pages_branch" ]]; then 343 | args+=(--pages-branch "$pages_branch") 344 | fi 345 | 346 | echo 'Releasing charts...' 347 | cr upload "${args[@]}" 348 | } 349 | 350 | update_index() { 351 | if [[ -n "$skip_upload" ]]; then 352 | echo "Skipping index upload..." 353 | return 354 | fi 355 | 356 | local args=(-o "$owner" -r "$repo" --push) 357 | if [[ -n "$config" ]]; then 358 | args+=(--config "$config") 359 | fi 360 | if [[ "$packages_with_index" = true ]]; then 361 | args+=(--packages-with-index --index-path .) 362 | fi 363 | if [[ -n "$pages_branch" ]]; then 364 | args+=(--pages-branch "$pages_branch") 365 | fi 366 | 367 | echo 'Updating charts repo index...' 368 | cr index "${args[@]}" 369 | } 370 | 371 | main "$@" 372 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright The Helm Authors. 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | --------------------------------------------------------------------------------