Skip to content

Commit 2ba0bcd

Browse files
author
Roy Razon
committed
add working-directory and fix release URLs
1 parent f94196c commit 2ba0bcd

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ If `gh-release` is specified, `version` can be either `latest` or one of the [re
6666

6767
Node package manager used for caching. Supported values: `npm`, `yarn`, `pnpm`, or ''. [Details](https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data). Default: `npm`.
6868

69+
### `working-directory`
70+
71+
*required*: `false`
72+
73+
Specifies the working directory where the Preevy CLI is run
74+
6975
## Example usage
7076

7177
```yaml

action.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ inputs:
2626
required: false
2727
description: "EXPERIMENTAL: Installation method of the Preevy CLI. Supported values: npm, gh-release or none"
2828
default: npm
29+
working-directory:
30+
required: false
31+
description: "Working directory where the preevy CLI will run"
2932
outputs: {}
3033
runs:
3134
using: "composite"
@@ -47,8 +50,8 @@ runs:
4750
function os_suffix() {
4851
case "${{ runner.os }}" in
4952
"Linux") echo -n "linux";;
50-
"Windows") echo -n "win";;
51-
"macOS") echo -n "macos";;
53+
"Windows") echo -n "win32";;
54+
"macOS") echo -n "darwin";;
5255
*) echo "No release for OS ${{ runner.os }}" 1>&2; exit 1;;
5356
esac
5457
}
@@ -63,16 +66,18 @@ runs:
6366
6467
release_version='${{ inputs.version }}'
6568
if [[ "${{ inputs.version }}" == "latest" ]]; then
66-
release_version=$(curl -s https://api.github.com/repos/livecycle/preevy/releases/latest | jq -r .tag_name)
69+
release_version=$(curl -sfL --retry-connrefused --retry 3 https://api.github.com/repos/livecycle/preevy/releases/latest | jq -r .tag_name)
6770
fi
6871
69-
release_file="preevy-$(os_suffix)-$(arch_suffix).tar"
72+
release_file="preevy-${release_version}-$(os_suffix)-$(arch_suffix).tar.gz"
7073
release_url="https://github.com/livecycle/preevy/releases/download/${release_version}/${release_file}"
7174
72-
wget -q "${release_url}" -O - | sudo tar -x -C /usr/local/bin
75+
curl -sfZL --retry-connrefused --retry 3 "${release_url}" | sudo tar -zx -C /usr/local/lib
76+
sudo ln -s /usr/local/lib/preevy/bin/preevy /usr/local/bin/preevy
7377
7478
- name: Run Preevy
7579
shell: bash
80+
working-directory: ${{ inputs.working-directory }}
7681
id: run_preevy
7782
run: |
7883
if [[ ! -z "${{ inputs.docker-compose-yaml-paths }}" ]]; then

0 commit comments

Comments
 (0)