Skip to content

Commit

Permalink
external script
Browse files Browse the repository at this point in the history
  • Loading branch information
gionn committed Mar 24, 2022
1 parent 9548fcc commit f8a16ce
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 33 deletions.
32 changes: 0 additions & 32 deletions .github/actions/helm-install/action.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/actions/setup-helm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Helm cli install"
description: "Install the helm CLI"
inputs:
helm-version:
description: The helm version to install
default: "3.8.1"
required: false
linux-bin-path:
description: Where to put the helm binary on linux runners
required: false
win-bin-path:
description: Where to put the helm binary on windows runners
required: false
runs:
using: "composite"
steps:
- name: Install helm cli
shell: bash
env:
LIN_PATH: ${{ inputs.linux-bin-path }}
WIN_PATH: ${{ inputs.win-bin-path }}
run: ${{ github.action_path }}/setup-helm.sh ${{ inputs.helm-version }}
15 changes: 15 additions & 0 deletions .github/actions/setup-helm/setup-helm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash -e
HELM_VERSION=$1
WIN_PATH=${WIN_PATH:-$HOME/bin/}
LIN_PATH=${LIN_PATH:-/usr/local/bin/}
if [ "$RUNNER_OS" == "Windows" ]; then
curl -fsSLo helm.zip https://get.helm.sh/helm-v${HELM_VERSION}-windows-amd64.zip
unzip -o helm.zip windows-amd64/helm.exe && rm helm.zip && mv windows-amd64/helm.exe "${WIN_PATH}" && rmdir windows-amd64
elif [ "$RUNNER_OS" == "Linux" ]; then
curl -fsSL https://get.helm.sh/helm-v${HELM_VERSION}-$(uname | tr '[:upper:]' '[:lower:]')-amd64.tar.gz | tar xz --strip=1 -C "${LIN_PATH}" $(uname | tr '[:upper:]' '[:lower:]')-amd64/helm
else
echo "$RUNNER_OS not supported"
exit 1
fi

echo helm $(helm version --client --short)
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ./.github/actions/helm-install
- uses: ./.github/actions/setup-helm
- uses: ./.github/actions/setup-helm-docs
- uses: ./.github/actions/setup-jx-release-version
- uses: ./.github/actions/setup-rancher-cli
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,19 @@
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)

Shared [Travis CI](https://travis-ci.com/) and [pre-commit](https://pre-commit.com/) configuration files plus misc tools.

## GitHub Actions

### setup-helm

If you need the helm cli available in the runner path:

```yml
jobs:

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-helm@master
```

0 comments on commit f8a16ce

Please sign in to comment.