Skip to content

Commit

Permalink
single download step
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog-crabnebula committed Oct 2, 2024
1 parent 5ecb0dc commit d9ad452
Showing 1 changed file with 12 additions and 26 deletions.
38 changes: 12 additions & 26 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,23 @@ runs:
run: |
: Download CLI
echo "Downloading CLI..."
if [[ "${{ runner.arch }}" == "X64" ]]; then
curl -L https://cdn.crabnebula.app/download/crabnebula/cn-cli/latest/platform/linux-binary-x86_64 --output cn
if [[ "${{ runner.os }}" == "Linux" ]]; then
if [[ "${{ runner.arch }}" == "X64" ]]; then
curl -L https://cdn.crabnebula.app/download/crabnebula/cn-cli/latest/platform/linux-binary-x86_64 --output cn
else
curl -L https://cdn.crabnebula.app/download/crabnebula/cn-cli/latest/platform/linux-binary-aarch64 --output cn
fi
elif [[ "${{ runner.os }}" == "macOS" ]]; then
curl -L https://cdn.crabnebula.app/download/crabnebula/cn-cli/latest/platform/darwin-binary-universal --output cn
elif [[ "${{ runner.os }}" == "Windows" ]]; then
curl -L https://cdn.crabnebula.app/download/crabnebula/cn-cli/latest/platform/windows-binary-x86_64 --output cn
else
curl -L https://cdn.crabnebula.app/download/crabnebula/cn-cli/latest/platform/linux-binary-aarch64 --output cn
echo "unsupported runner ${{ runner.os }}, only Linux, macOS and Windows are supported"
exit 1
fi
chmod +x cn
echo "cn-path=$(realpath cn)" >> $GITHUB_OUTPUT
- name: Download CLI (macOS)
id: download-cn-cli
shell: bash
if: steps.restore-cache.outputs.cache-hit != 'true' && runner.os == 'macOS'
working-directory: ${{ inputs.path }}
run: |
: Download CLI
echo "Downloading CLI..."
curl -L https://cdn.crabnebula.app/download/crabnebula/cn-cli/latest/platform/darwin-binary-universal --output cn
chmod +x cn
echo "cn-path=$(realpath cn)" >> $GITHUB_OUTPUT
- name: Download CLI (Windows)
id: download-cn-cli
shell: bash
if: steps.restore-cache.outputs.cache-hit != 'true' && runner.os == 'Windows'
working-directory: ${{ inputs.path }}
run: |
: Download CLI
echo "Downloading CLI..."
curl -L https://cdn.crabnebula.app/download/crabnebula/cn-cli/latest/platform/windows-binary-x86_64 --output cn
echo "cn-path=$(realpath cn)" >> $GITHUB_OUTPUT
# - uses: actions/cache/save@v4
# continue-on-error: true
# with:
Expand Down

0 comments on commit d9ad452

Please sign in to comment.