|
1 | 1 | #!/bin/bash
|
2 | 2 |
|
3 |
| -VIB_VERSION="1.0.0" |
| 3 | +VIB_VERSION="1.0.1" |
4 | 4 | PLUGINS_ARG="${1:-}"
|
5 | 5 |
|
6 |
| -wget "https://github.com/Vanilla-OS/Vib/releases/download/v$VIB_VERSION/plugins.tar.xz" |
7 |
| -tar -xf plugins.tar.xz |
| 6 | +case "$RUNNER_ARCH" in |
| 7 | + X64) ARCH="amd64" ;; |
| 8 | + ARM64) ARCH="arm64" ;; |
| 9 | + *) echo "Unsupported runner architecture: $RUNNER_ARCH"; exit 1 ;; |
| 10 | +esac |
| 11 | + |
| 12 | +echo "Detected architecture: $ARCH" |
| 13 | + |
| 14 | +wget "https://github.com/Vanilla-OS/Vib/releases/download/v$VIB_VERSION/plugins-$ARCH.tar.xz" |
| 15 | +tar -xf plugins-$ARCH.tar.xz |
8 | 16 | mv build/plugins plugins
|
9 | 17 |
|
10 | 18 | if [ -z "$PLUGINS_ARG" ]; then
|
11 |
| - echo "No plugins specified, using static Vib binary" |
| 19 | + echo "No plugins specified, using static Vib binary" |
12 | 20 | else
|
13 |
| - echo "Plugins specified, downloading plugin assets..." |
14 |
| - |
15 |
| - IFS=',' read -ra PLUGIN_LIST <<<"$PLUGINS_ARG" |
16 |
| - for PLUGIN in "${PLUGIN_LIST[@]}"; do |
17 |
| - REPO=$(echo "$PLUGIN" | awk -F':' '{print $1}') |
18 |
| - TAG=$(echo "$PLUGIN" | awk -F':' '{print $2}') |
19 |
| - |
20 |
| - echo "Downloading assets for $REPO..." |
21 |
| - |
22 |
| - ASSETS_URL="https://api.github.com/repos/$REPO/releases/tags/$TAG" |
23 |
| - ASSET_URLS=$(curl -s "$ASSETS_URL" | grep -o -E 'https://github.com/[^"]+\.so') |
24 |
| - |
25 |
| - for ASSET_URL in $ASSET_URLS; do |
26 |
| - wget -P plugins/ "$ASSET_URL" |
27 |
| - done |
28 |
| - done |
| 21 | + echo "Plugins specified, downloading plugin assets..." |
| 22 | + |
| 23 | + IFS=',' read -ra PLUGIN_LIST <<<"$PLUGINS_ARG" |
| 24 | + for PLUGIN in "${PLUGIN_LIST[@]}"; do |
| 25 | + REPO=$(echo "$PLUGIN" | awk -F':' '{print $1}') |
| 26 | + TAG=$(echo "$PLUGIN" | awk -F':' '{print $2}') |
| 27 | + |
| 28 | + echo "Downloading assets for $REPO..." |
| 29 | + |
| 30 | + ASSETS_URL="https://api.github.com/repos/$REPO/releases/tags/$TAG" |
| 31 | + if [[ "$ARCH" == "arm64" ]]; then |
| 32 | + ASSET_URLS=$(curl -s "$ASSETS_URL" | grep -o -E 'https://github.com/[^"]+arm64[^"]*\.so') |
| 33 | + if [ -z "$ASSET_URLS" ]; then |
| 34 | + ASSET_URLS=$(curl -s "$ASSETS_URL" | grep -o -E 'https://github.com/[^"]+\.so') |
| 35 | + fi |
| 36 | + else |
| 37 | + ASSET_URLS=$(curl -s "$ASSETS_URL" | grep -o -E 'https://github.com/[^"]+\.so') |
| 38 | + fi |
| 39 | + |
| 40 | + for ASSET_URL in $ASSET_URLS; do |
| 41 | + wget -P plugins/ "$ASSET_URL" |
| 42 | + done |
| 43 | + done |
29 | 44 | fi
|
30 | 45 |
|
31 |
| -wget "https://github.com/Vanilla-OS/Vib/releases/download/v$VIB_VERSION/vib" |
| 46 | +wget -O vib "https://github.com/Vanilla-OS/Vib/releases/download/v$VIB_VERSION/vib-$ARCH" |
32 | 47 | chmod +x vib
|
0 commit comments