-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
41 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
# GitHub repo details | ||
USER="koodo-reader" | ||
REPO="koodo-reader" | ||
TAG="v1.6.1" | ||
|
||
# Backblaze details | ||
BUCKET="koodo-reader" | ||
B2_ACCOUNT_ID=$1 | ||
B2_APPLICATION_KEY=$2 | ||
|
||
|
||
# Create a directory with the name of the tag | ||
mkdir -p $TAG | ||
|
||
# Get the release details from GitHub API | ||
RELEASE=$(curl --silent "https://api.github.com/repos/$USER/$REPO/releases/tags/$TAG") | ||
|
||
# Get the assets from the release | ||
ASSETS=$(echo $RELEASE | jq -r '.assets[] | .browser_download_url') | ||
|
||
# Download each asset | ||
for ASSET in $ASSETS; do | ||
curl -L -o $TAG/$(basename $ASSET) $ASSET | ||
done | ||
|
||
# Install B2 CLI | ||
wget https://github.com/Backblaze/B2_Command_Line_Tool/releases/latest/download/b2-linux | ||
mv b2-linux b2 | ||
chmod +x ./b2 | ||
./b2 authorize-account $B2_ACCOUNT_ID $B2_APPLICATION_KEY | ||
|
||
# Upload the directory to Backblaze | ||
./b2 sync --replaceNewer $TAG b2://$BUCKET/$TAG |