Skip to content

Commit

Permalink
Extract macOS package manually
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Harding <[email protected]>
  • Loading branch information
klutchell committed May 3, 2024
1 parent 40e176d commit cd3e3c5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 13 deletions.
9 changes: 9 additions & 0 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ runs:
steps:
- name: Test setup of AWS CLI
uses: ./
with:
skip-cache: 'true'
- name: Print AWS CLI version
shell: bash
run: aws --version
- name: Test setup of AWS CLI
uses: ./
with:
skip-cache: 'false'
- name: Print AWS CLI version
shell: bash
run: aws --version
39 changes: 26 additions & 13 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,39 +86,52 @@ runs:
with:
gpg_private_key: ${{ env.GPG_PRIVATE_KEY }}

- name: Create temporary directory
id: tempdir
if: steps.cache.outputs.cache-hit != true
working-directory: ${{ runner.temp }}
shell: bash --noprofile --norc -eo pipefail -x {0}
run: |
path="$(mktemp -d -p "${{ runner.temp }}")"
echo "path=${path}" >> "${GITHUB_OUTPUT}"
echo "basename=$(basename "${path}")" >> "${GITHUB_OUTPUT}"
# https://docs.aws.amazon.com/cli/latest/userguide/getting-started-version.html
- name: Install AWS CLI (Linux)
if: steps.cache.outputs.cache-hit != true && runner.os == 'Linux'
working-directory: ${{ runner.temp }}
working-directory: ${{ steps.tempdir.outputs.path }}
shell: bash --noprofile --norc -eo pipefail -x {0}
run: |
mkdir -p awscliv2
cd awscliv2
curl -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-${{ steps.platform.outputs.arch }}-${{ inputs.version }}.zip" -o awscliv2.zip
curl -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-${{ steps.platform.outputs.arch }}-${{ inputs.version }}.zip.sig" -o awscliv2.sig
gpg --verify awscliv2.sig awscliv2.zip
unzip awscliv2.zip
find . -name aws
unzip -q awscliv2.zip
mv aws/dist awscliv2
./awscliv2/aws --version
# https://docs.aws.amazon.com/cli/latest/userguide/getting-started-version.html
# https://gist.github.com/ugultopu/1adf8e08acb87be649d69419cf7aca3c
- name: Install AWS CLI (macOS)
if: steps.cache.outputs.cache-hit != true && runner.os == 'macOS'
working-directory: ${{ runner.temp }}
working-directory: ${{ steps.tempdir.outputs.path }}
shell: bash --noprofile --norc -eo pipefail -x {0}
run: |
mkdir -p awscliv2
cd awscliv2
curl -fsSL "https://awscli.amazonaws.com/AWSCLIV2-${{ inputs.version }}.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg ./AWSCLIV2.pkg -target ./
find . -name aws
pkgutil --expand-full ./AWSCLIV2.pkg awscliv2_pkg
mv ./awscliv2_pkg/aws-cli.pkg/Payload/aws-cli awscliv2
./awscliv2/aws --version
# https://github.com/AnimMouse/tool-cache
- name: Update tool cache
uses: AnimMouse/tool-cache@5c73a08045bdef61c81a6c60d208cff7ab36f3aa # v1
with:
folder_name: awscliv2
folder_name: ${{ steps.tempdir.outputs.basename }}/awscliv2
cache_hit: ${{ steps.cache.outputs.cache-hit }}

- name: Print AWS CLI version
shell: bash
shell: bash --noprofile --norc -eo pipefail -x {0}
working-directory: ${{ runner.temp }}
run: |
which aws
find "${{ runner.tool_cache }}" -type f -name aws
which -a aws | grep '${{ runner.tool_cache }}'
aws --version

0 comments on commit cd3e3c5

Please sign in to comment.