-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yml
More file actions
55 lines (48 loc) · 1.55 KB
/
action.yml
File metadata and controls
55 lines (48 loc) · 1.55 KB
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
54
55
# Copyright IBM Corp. 2023
# Made available under the MIT License
name: "Install StepZen CLI"
author: "IBM"
description: |
Install the StepZen CLI. Assumes Node is already installed.
inputs:
version:
description: "StepZen CLI Version (defaults to latest)"
required: true
default: latest
runs:
using: "composite"
steps:
- name: Get version
id: get-version
shell: bash
run: |
if [[ "${{ inputs.version }}" == "latest" ]]; then
echo "cli_version=$(npm view stepzen version)" >> $GITHUB_OUTPUT
else
echo "cli_version=${VERSION}" >> $GITHUB_OUTPUT
fi
- name: Cache stepzen cli
id: cache-stepzen-cli
uses: actions/cache@v4
with:
path: |
~/stepzen-install
key: stepzen-cli-${{ steps.get-version.outputs.cli_version }}
- name: create npm package for cache
if: steps.cache-stepzen-cli.outputs.cache-hit != 'true'
# retry due to occasional npm failure
uses: nick-fields/retry@v3
with:
timeout_seconds: 120
max_attempts: 3
retry_wait_seconds: 2
shell: bash
command: |
mkdir -p ~/stepzen-install
npm pack stepzen@${{ steps.get-version.outputs.cli_version }} --pack-destination ~/stepzen-install
- name: Install stepzen cli from cache
shell: bash
run: |
npm install --location=global ~/stepzen-install/stepzen-${{ steps.get-version.outputs.cli_version }}.tgz
- run: stepzen version
shell: bash