Update debricked-cli.yml #5
Workflow file for this run
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
name: Update Debricked CLI | |
on: | |
push: | |
branches: ['**'] | |
jobs: | |
update-cli: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: '6-integrate-debricked-cli-with-vs-code-extension-2' | |
- 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_urls=$(echo "$latest_release" | jq -r '.assets[] | select(.name | endswith("cli_linux_arm64.tar.gz") or endswith("cli_windows_x86_64.tar.gz") or endswith("cli_linux_i386.tar.gz")).browser_download_url') | |
echo "download_urls=$download_urls" >> $GITHUB_OUTPUT | |
- name: Download latest releases | |
run: | | |
mkdir -p resources/debricked-cli | |
for url in ${{ steps.get_latest_release.outputs.download_urls }}; do | |
filename=$(basename "$url") | |
echo "Downloading $filename from $url" | |
curl -L "$url" -o "resources/debricked-cli/$filename" | |
done | |
- name: Extract Debricked CLI | |
run: | | |
for file in resources/debricked-cli/*.tar.gz; do | |
tar -xzf "$file" -C resources/debricked-cli | |
rm "$file" | |
done | |
- 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 | |
git commit -m "Update Debricked CLI to latest release" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |