Skip to content

Commit 02f4ef6

Browse files
kbdharunaxtloss
authored andcommitted
chore: bump Vib to v1.0.1, add detection and setup for arm64
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
1 parent 63ed4f9 commit 02f4ef6

File tree

2 files changed

+37
-22
lines changed

2 files changed

+37
-22
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ See [action.yml](action.yml)
99
```yml
1010
steps:
1111
- uses: actions/checkout@v4
12-
- uses: vanilla-os/vib-gh-action@v1.0.0
12+
- uses: vanilla-os/vib-gh-action@v1.0.1
1313
with:
1414
recipe: 'myRecipe.yml'
1515
plugins: org/repo:tag,org/repo:tag

setup.sh

+36-21
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,47 @@
11
#!/bin/bash
22

3-
VIB_VERSION="1.0.0"
3+
VIB_VERSION="1.0.1"
44
PLUGINS_ARG="${1:-}"
55

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
816
mv build/plugins plugins
917

1018
if [ -z "$PLUGINS_ARG" ]; then
11-
echo "No plugins specified, using static Vib binary"
19+
echo "No plugins specified, using static Vib binary"
1220
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
2944
fi
3045

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"
3247
chmod +x vib

0 commit comments

Comments
 (0)