-
Notifications
You must be signed in to change notification settings - Fork 2
107 lines (91 loc) · 4.84 KB
/
debricked-cli.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
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: Clear resources/debricked-cli
run: |
rm -rf resources/debricked-cli/*
mkdir -p resources/debricked-cli
- name: Get latest release info - cli_windows_x86_64
id: cli_windows_x86_64
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
- name: Download latest release - cli_windows_x86_64
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
- 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
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 commit -m "Update Debricked CLI to latest release"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get latest release info - cli_windows_arm64
id: cli_windows_arm64
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_arm64.tar.gz")).browser_download_url')
echo "Download URL: $download_url"
echo "download_url=$download_url" >> $GITHUB_OUTPUT
- name: Download latest release - cli_windows_arm64
run: |
mkdir -p resources/debricked-cli/cli_windows_arm64
echo "Download URL: ${{ steps.cli_windows_arm64.outputs.download_url }}"
curl -L ${{ steps.cli_windows_arm64.outputs.download_url }} -o resources/debricked-cli/cli_windows_arm64/debricked-cli.tar.gz
- name: Extract Debricked CLI - cli_windows_arm64
run: |
tar -xzf resources/debricked-cli/cli_windows_arm64/debricked-cli.tar.gz -C resources/debricked-cli/cli_windows_arm64
rm resources/debricked-cli/cli_windows_arm64/debricked-cli.tar.gz
- name: Commit changes - cli_windows_arm64
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_arm64
git commit -m "Update Debricked CLI to latest release"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}