-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move tool installation from
setup-pack
to a new setup-tools
action
Previously the `setup-pack` action installed not only the Pack CLI, but also three additional tools: `crane`, `jq` and `yj`. These additional tools are only needed in a subset of cases, however there was no way to prevent their installation. Now, the `setup-pack` action only installs the Pack CLI, and a new `setup-tools` action has been added, which installs `crane` and `yj`. This new action does not install `jq` (unlike the previous `setup-pack` implementation), since `jq` is already installed in all of GitHub Actions' base images. In addition, the default versions of tools have been bumped as follows: - `crane`: `0.6.0` -> `0.12.1` - `yj`: `5.0.0` -> `5.1.0` Closes #121. Signed-off-by: Ed Morley <501702+edmorley@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
75 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: 'Setup tools' | ||
description: 'Install the tools crane and yq, and add them to $PATH' | ||
author: 'Cloud Native Buildpacks' | ||
|
||
inputs: | ||
crane-version: | ||
description: 'The version of crane to install' | ||
required: false | ||
default: '0.12.1' | ||
yj-version: | ||
description: 'The version of yj to install' | ||
required: false | ||
default: '5.1.0' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install additional buildpack management tools | ||
shell: bash | ||
run: | | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
mkdir -p "${HOME}"/bin | ||
echo "PATH=${HOME}/bin:${PATH}" >> "${GITHUB_ENV}" | ||
CRANE_VERSION=${{ inputs.crane-version }} | ||
echo "Installing crane ${CRANE_VERSION}" | ||
curl \ | ||
--show-error \ | ||
--silent \ | ||
--location \ | ||
--fail \ | ||
--retry 3 \ | ||
--connect-timeout 5 \ | ||
--max-time 60 \ | ||
"https://github.com/google/go-containerregistry/releases/download/v${CRANE_VERSION}/go-containerregistry_Linux_x86_64.tar.gz" \ | ||
| tar -C "${HOME}/bin" -xz crane | ||
YJ_VERSION=${{ inputs.yj-version }} | ||
echo "Installing yj ${YJ_VERSION}" | ||
curl \ | ||
--show-error \ | ||
--silent \ | ||
--location \ | ||
--fail \ | ||
--retry 3 \ | ||
--connect-timeout 5 \ | ||
--max-time 60 \ | ||
--output "${HOME}/bin/yj" \ | ||
"https://github.com/sclevine/yj/releases/download/v${YJ_VERSION}/yj-linux" | ||
chmod +x "${HOME}"/bin/yj |