mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-24 02:00:24 +07:00
fix: add checks for script components to find out where it can fall (#2169)
This commit is contained in:
+28
-10
@@ -1,9 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
VERSION=$1
|
VERSION=$1
|
||||||
|
|
||||||
if [[ $VERSION = '' ]]; then
|
if [[ -z "$VERSION" ]]; then
|
||||||
echo '::error::VERSION does not set. Exiting with error...'
|
echo '::error::VERSION does not set. Exiting with error...'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -20,14 +20,32 @@ if [[ $(cat CHANGELOG) = null ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
wget -q https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_android9+_arm64-v8a.apk
|
# Download files with error handling
|
||||||
wget -q https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_android9+_armeabi-v7a.apk
|
download_file() {
|
||||||
wget -q https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_android9+_x86.apk
|
local url=$1
|
||||||
wget -q https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_android9+_x86_64.apk
|
local filename=$(basename "$url")
|
||||||
wget -q https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_linux_x64.tar
|
echo "Downloading $filename..."
|
||||||
wget -q https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_macos.pkg
|
if ! wget -q "$url"; then
|
||||||
wget -q https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_x64.exe
|
echo "::error::Failed to download $filename from $url"
|
||||||
|
exit 8
|
||||||
|
fi
|
||||||
|
echo "Successfully downloaded $filename"
|
||||||
|
}
|
||||||
|
|
||||||
|
download_file https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_android9+_arm64-v8a.apk
|
||||||
|
download_file https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_android9+_armeabi-v7a.apk
|
||||||
|
download_file https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_android9+_x86.apk
|
||||||
|
download_file https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_android9+_x86_64.apk
|
||||||
|
download_file https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_linux_x64.tar
|
||||||
|
download_file https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_macos.pkg
|
||||||
|
download_file https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_x64.exe
|
||||||
|
|
||||||
cd ../
|
cd ../
|
||||||
|
|
||||||
rclone sync ./dist/ r2:/updates/
|
echo "Syncing to R2..."
|
||||||
|
if ! rclone sync ./dist/ r2:/updates/; then
|
||||||
|
echo "::error::Failed to sync files to R2"
|
||||||
|
exit 8
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Deployment completed successfully!"
|
||||||
|
|||||||
Reference in New Issue
Block a user