diff --git a/action.yml b/action.yml deleted file mode 100644 index e92bde4..0000000 --- a/action.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Setup Pack CLI' -description: 'Setup a Pack CLI and add it to the PATH' -author: 'Buildpacks.io' -inputs: - version: - description: 'The Pack version to download and use.' - required: true - default: '0.14.1' -runs: - using: "composite" - steps: - - run: ${{ github.action_path }}/dist/pack.sh "${{ inputs.version }}" - shell: bash diff --git a/dist/pack.sh b/dist/pack.sh deleted file mode 100755 index 884b185..0000000 --- a/dist/pack.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -pack_version="${1}" -jq_version="1.6" -crane_version="0.1.4" -yj_version="5.0.0" - -mkdir -p "$HOME/bin" - -echo "---> Installing jq ${jq_version}" -curl \ - --retry 3 \ - --output "${HOME}/bin/jq" \ - --location \ - --show-error \ - --silent \ - "https://github.com/stedolan/jq/releases/download/jq-${jq_version}/jq-linux64" -chmod +x "${HOME}/bin/jq" - -echo "---> Installing crane ${crane_version}" -curl \ - --retry 3 \ - --location \ - --show-error \ - --silent \ - "https://github.com/google/go-containerregistry/releases/download/v${crane_version}/go-containerregistry_Linux_x86_64.tar.gz" \ - | tar -C "${HOME}/bin/" -xzv crane - -echo "---> Installing yj ${yj_version}" -curl \ - --retry 3 \ - --output "${HOME}/bin/yj" \ - --location \ - --show-error \ - --silent \ - "https://github.com/sclevine/yj/releases/download/v${yj_version}/yj-linux" -chmod +x "${HOME}/bin/yj" - -echo "---> Installing pack ${pack_version}" -curl \ - --retry 3 \ - --location \ - --show-error \ - --silent \ - "https://github.com/buildpacks/pack/releases/download/v${pack_version}/pack-v${pack_version}-linux.tgz" \ - | tar -C "${HOME}/bin/" -xzv pack - -echo "PATH=${HOME}/bin:${PATH}" >> $GITHUB_ENV diff --git a/setup-pack/action.yml b/setup-pack/action.yml new file mode 100644 index 0000000..817ea84 --- /dev/null +++ b/setup-pack/action.yml @@ -0,0 +1,72 @@ +name: 'Setup pack CLI' +description: 'Setup the Cloud Native Buildpacks pack CLI as well as other useful tools and add them to $PATH' +author: 'Cloud Native Buildpacks' + +inputs: + crane-version: + description: 'The version of crane to install' + required: false + default: '0.1.4' + jq-version: + description: 'The version of jq to install' + required: false + default: '1.6' + pack-version: + description: 'The version of pack to install' + required: false + default: '0.14.2' + yj-version: + description: 'The version of yj to install' + required: false + default: '5.0.0' + +runs: + using: "composite" + steps: + - name: Setup pack CLI + 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 \ + "https://github.com/google/go-containerregistry/releases/download/v${CRANE_VERSION}/go-containerregistry_Linux_x86_64.tar.gz" \ + | tar -C "${HOME}/bin" -xz crane + + JQ_VERSION=${{ inputs.jq-version }} + echo "Installing jq ${JQ_VERSION}" + curl \ + --show-error \ + --silent \ + --location \ + --output "${HOME}/bin/jq" \ + "https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64" + chmod +x "${HOME}"/bin/jq + + PACK_VERSION=${{ inputs.pack-version }} + echo "Installing pack ${PACK_VERSION}" + curl \ + --show-error \ + --silent \ + --location \ + "https://github.com/buildpacks/pack/releases/download/v${PACK_VERSION}/pack-v${PACK_VERSION}-linux.tgz" \ + | tar -C "${HOME}/bin" -xz pack + + YJ_VERSION=${{ inputs.yj-version }} + echo "Installing yj ${YJ_VERSION}" + curl \ + --show-error \ + --silent \ + --location \ + --output "${HOME}/bin/yj" \ + "https://github.com/sclevine/yj/releases/download/v${YJ_VERSION}/yj-linux" + chmod +x "${HOME}"/bin/yj