-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
53 lines (45 loc) · 1.57 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: setup-crossplane-cli
description: |
Install the Crossplane CLI for use in GitHub workflows.
See https://docs.crossplane.io/latest/cli.
inputs:
channel:
description: The release channel from which to install. Default is 'stable'.
required: false
default: stable
version:
description: The version of the Crossplane CLI to install. Default is 'latest'.
required: false
default: latest
branding:
icon: 'command'
color: 'blue'
runs:
using: composite
steps:
- name: Install Crossplane CLI
shell: bash
run: |
set -eu
if [ "${{ inputs.channel }}" != "stable" ]; then
export XP_CHANNEL="${{ inputs.channel }}"
fi
if [ "${{ inputs.version }}" != "latest" ]; then
export XP_VERSION="${{ inputs.version }}"
fi
mkdir -p $GITHUB_WORKSPACE/bin
cd $GITHUB_WORKSPACE/bin
echo "Installing Crossplane CLI..."
curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh" | sh
chmod +x $GITHUB_WORKSPACE/bin/crossplane
set +e
$GITHUB_WORKSPACE/bin/crossplane version --client &> /dev/null
code=$?
set -e
if [ $code -eq 0 ]; then
echo "Crossplane CLI installed version: $($GITHUB_WORKSPACE/bin/crossplane version --client)"
else
echo "Crossplane CLI installed version: $($GITHUB_WORKSPACE/bin/crossplane --version)"
fi
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
echo "$RUNNER_WORKSPACE/$(basename $GITHUB_REPOSITORY)/bin" >> $GITHUB_PATH