2026-01-30 09:43:30 +03:00
|
|
|
#!/bin/bash
|
2025-04-16 05:35:53 +03:00
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
VERSION=$1
|
|
|
|
|
|
2026-01-30 09:43:30 +03:00
|
|
|
if [[ -z "$VERSION" ]]; then
|
2025-04-16 05:35:53 +03:00
|
|
|
echo '::error::VERSION does not set. Exiting with error...'
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
mkdir -p dist
|
|
|
|
|
|
|
|
|
|
cd dist
|
|
|
|
|
|
2026-05-04 07:37:19 +03:00
|
|
|
echo $VERSION > VERSION
|
|
|
|
|
curl -s https://api.github.com/repos/amnezia-vpn/amnezia-client/releases/tags/$VERSION | jq -r .published_at > RELEASE_DATE
|
2025-04-16 05:35:53 +03:00
|
|
|
curl -s https://api.github.com/repos/amnezia-vpn/amnezia-client/releases/tags/$VERSION | jq -r .body | tr -d '\r' > CHANGELOG
|
2026-02-04 07:38:44 +00:00
|
|
|
curl -s https://api.github.com/repos/amnezia-vpn/amnezia-client/releases/tags/$VERSION | jq -r .published_at > RELEASE_DATE
|
2025-04-16 05:35:53 +03:00
|
|
|
|
|
|
|
|
if [[ $(cat CHANGELOG) = null ]]; then
|
|
|
|
|
echo '::error::Release does not exists. Exiting with error...'
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2026-01-30 09:43:30 +03:00
|
|
|
# Download files with error handling
|
|
|
|
|
download_file() {
|
|
|
|
|
local url=$1
|
|
|
|
|
local filename=$(basename "$url")
|
|
|
|
|
echo "Downloading $filename..."
|
|
|
|
|
if ! wget -q "$url"; then
|
|
|
|
|
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
|
2026-05-20 19:07:30 +08:00
|
|
|
download_file https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_linux_x64.run
|
|
|
|
|
download_file https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_macos_x64.pkg
|
|
|
|
|
download_file https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_windows_x64.exe
|
2025-04-16 05:35:53 +03:00
|
|
|
|
|
|
|
|
cd ../
|
|
|
|
|
|
2026-01-30 09:43:30 +03:00
|
|
|
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!"
|