Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagarjun Sanji committed Jul 2, 2024
1 parent ac4831c commit a40ce7d
Showing 1 changed file with 16 additions and 46 deletions.
62 changes: 16 additions & 46 deletions .github/workflows/debricked-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,61 +14,31 @@ jobs:
with:
ref: '6-integrate-debricked-cli-with-vs-code-extension-2'

- name: Get latest release info - cli_windows_x86_64
id: cli_windows_x86_64
- name: Get latest release info
id: get_latest_release
run: |
latest_release=$(curl -s https://api.github.com/repos/debricked/cli/releases/tags/v2.0.3)
download_url=$(echo "$latest_release" | jq -r '.assets[] | select(.name | endswith("cli_windows_x86_64.tar.gz")).browser_download_url')
echo "Download URL: $download_url"
echo "download_url=$download_url" >> $GITHUB_OUTPUT
echo "latest_release=$latest_release" >> $GITHUB_ENV
- name: Download latest release - cli_windows_x86_64
- name: Download and extract CLI
id: download_and_extract
run: |
mkdir -p resources/debricked-cli/cli_windows_x86_64
echo "Download URL: ${{ steps.cli_windows_x86_64.outputs.download_url }}"
curl -L ${{ steps.cli_windows_x86_64.outputs.download_url }} -o resources/debricked-cli/cli_windows_x86_64/debricked-cli.tar.gz
assets=("cli_windows_x86_64.tar.gz" "cli_windows_i386.tar.gz","cli_windows_arm64.tar.gz")
for asset in "${assets[@]}"; do
download_url=$(echo "$latest_release" | jq -r ".assets[] | select(.name == \"$asset\").browser_download_url")
dir_name="${asset%.*.*}" # Remove ".tar.gz" from filename
mkdir -p "resources/debricked-cli/$dir_name"
curl -L "$download_url" -o "resources/debricked-cli/$dir_name/debricked-cli.tar.gz"
tar -xzf "resources/debricked-cli/$dir_name/debricked-cli.tar.gz" -C "resources/debricked-cli/$dir_name"
rm "resources/debricked-cli/$dir_name/debricked-cli.tar.gz"
done
- name: Extract Debricked CLI - cli_windows_x86_64
run: |
tar -xzf resources/debricked-cli/cli_windows_x86_64/debricked-cli.tar.gz -C resources/debricked-cli/cli_windows_x86_64
rm resources/debricked-cli/cli_windows_x86_64/debricked-cli.tar.gz
- name: Commit changes - cli_windows_x86_64
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add resources/debricked-cli/cli_windows_x86_64
git commit -m "Update Debricked CLI to latest release"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get latest release info - cli_windows_i386
id: cli_windows_i386
run: |
latest_release=$(curl -s https://api.github.com/repos/debricked/cli/releases/tags/v2.0.3)
download_url=$(echo "$latest_release" | jq -r '.assets[] | select(.name | endswith("cli_windows_i386.tar.gz")).browser_download_url')
echo "Download URL: $download_url"
echo "download_url=$download_url" >> $GITHUB_OUTPUT
- name: Download latest release - cli_windows_i386
run: |
mkdir -p resources/debricked-cli/cli_windows_i386
echo "Download URL: ${{ steps.cli_windows_i386.outputs.download_url }}"
curl -L ${{ steps.cli_windows_i386.outputs.download_url }} -o resources/debricked-cli/cli_windows_i386/debricked-cli.tar.gz
- name: Extract Debricked CLI - cli_windows_i386
run: |
tar -xzf resources/debricked-cli/cli_windows_i386/debricked-cli.tar.gz -C resources/debricked-cli/cli_windows_i386
rm resources/debricked-cli/cli_windows_i386/debricked-cli.tar.gz
- name: Commit changes - cli_windows_i386
- name: Commit changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add resources/debricked-cli/cli_windows_i386
git add resources/debricked-cli
git commit -m "Update Debricked CLI to latest release"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a40ce7d

Please sign in to comment.