Skip to content

Commit

Permalink
update chart release action to use CR release v1.4.0
Browse files Browse the repository at this point in the history
Signed-off-by: cpanato <ctadeu@gmail.com>
  • Loading branch information
cpanato committed Mar 27, 2022
1 parent 6208805 commit 315680b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
- uses: actions/checkout@v2
- name: Install chart-releaser
uses: ./
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Check install!
run: cr version
- name: Check root directory
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A GitHub action to turn a GitHub project into a self-hosted Helm chart repo, usi

### Pre-requisites

1. A GitHub repo containing a directory with your Helm charts (default is a folder named `/charts`, if you want to
1. A GitHub repo containing a directory with your Helm charts (default is a folder named `/charts`, if you want to
maintain your charts in a different directory, you must include a `charts_dir` input in the workflow).
1. A GitHub branch called `gh-pages` to store the published charts. See `charts_repo_url` for alternatives.
1. In your repo, go to Settings/Pages. Change the `Source` `Branch` to `gh-pages`.
Expand All @@ -15,7 +15,7 @@ maintain your charts in a different directory, you must include a `charts_dir` i

### Inputs

- `version`: The chart-releaser version to use (default: v1.3.0)
- `version`: The chart-releaser version to use (default: v1.4.0)
- `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)
- `charts_dir`: The charts directory
- `charts_repo_url`: The GitHub Pages URL to the charts repo (default: `https://<owner>.github.io/<project>`)
Expand Down Expand Up @@ -55,10 +55,10 @@ jobs:
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.7.1
version: v3.8.1

- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.3.0
uses: helm/chart-releaser-action@v1.4.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
```
Expand All @@ -71,7 +71,7 @@ It does this – during every push to `main` – by checking each chart in your
`workflow.yml`:
```yaml
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.2.0
uses: helm/chart-releaser-action@v1.4.0
with:
charts_dir: charts
config: cr.yaml
Expand All @@ -81,6 +81,7 @@ It does this – during every push to `main` – by checking each chart in your
```

`cr.yaml`:

```yaml
owner: myaccount
git-base-url: https://api.github.com/
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ branding:
icon: anchor
inputs:
version:
description: "The chart-releaser version to use (default: v1.3.0)"
description: "The chart-releaser version to use (default: v1.4.0)"
required: false
config:
description: "The relative path to the chart-releaser config file"
required: false
charts_dir:
description: The charts directory
required: false
default: charts
charts_repo_url:
description: "The GitHub Pages URL to the charts repo (default: https://<owner>.github.io/<repo>)"
required: false
runs:
using: composite
steps:
Expand Down
5 changes: 3 additions & 2 deletions cr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set -o errexit
set -o nounset
set -o pipefail

DEFAULT_CHART_RELEASER_VERSION=v1.3.0
DEFAULT_CHART_RELEASER_VERSION=v1.4.0

show_help() {
cat << EOF
Expand Down Expand Up @@ -185,7 +185,7 @@ install_chart_releaser() {
local arch
arch=$(uname -m)

local cache_dir="$RUNNER_TOOL_CACHE/ct/$version/$arch"
local cache_dir="$RUNNER_TOOL_CACHE/cr/$version/$arch"
if [[ ! -d "$cache_dir" ]]; then
mkdir -p "$cache_dir"

Expand All @@ -197,6 +197,7 @@ install_chart_releaser() {

echo 'Adding cr directory to PATH...'
export PATH="$cache_dir:$PATH"
echo $cache_dir >> $GITHUB_PATH
}

lookup_latest_tag() {
Expand Down

0 comments on commit 315680b

Please # to comment.