Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
colorsakura committed Oct 27, 2023
1 parent 131f963 commit afc2954
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion create-db-and-upload-action/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ FROM archlinux:latest
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN date
RUN pacman -Syu --noconfirm
RUN pacman -S base-devel git python rclone pyalpm --noconfirm && sed -i '/E_ROOT/d' /usr/bin/makepkg
RUN pacman -S base-devel git python rclone pyalpm tree --noconfirm && sed -i '/E_ROOT/d' /usr/bin/makepkg
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
47 changes: 24 additions & 23 deletions create-db-and-upload-action/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
#!/bin/bash
set -e

tree

init_path=$PWD
mkdir upload_packages
cp $local_path/*/*/*.tar.zst ./upload_packages/

if [ ! -f ~/.config/rclone/rclone.conf ]; then
mkdir --parents ~/.config/rclone
echo "[onedrive]" >> ~/.config/rclone/rclone.conf
echo "type = onedrive" >> ~/.config/rclone/rclone.conf

echo "client_id=$RCLONE_ONEDRIVE_CLIENT_ID" >> ~/.config/rclone/rclone.conf
echo "client_secret=$RCLONE_ONEDRIVE_CLIENT_SECRET" >> ~/.config/rclone/rclone.conf
echo "region=$RCLONE_ONEDRIVE_REGION" >> ~/.config/rclone/rclone.conf
echo "drive_type=$RCLONE_ONEDRIVE_DRIVE_TYPE" >> ~/.config/rclone/rclone.conf
echo "token=$RCLONE_ONEDRIVE_TOKEN" >> ~/.config/rclone/rclone.conf
echo "drive_id=$RCLONE_ONEDRIVE_DRIVE_ID" >> ~/.config/rclone/rclone.conf
mkdir --parents ~/.config/rclone
echo "[onedrive]" >>~/.config/rclone/rclone.conf
echo "type = onedrive" >>~/.config/rclone/rclone.conf

echo "client_id=$RCLONE_ONEDRIVE_CLIENT_ID" >>~/.config/rclone/rclone.conf
echo "client_secret=$RCLONE_ONEDRIVE_CLIENT_SECRET" >>~/.config/rclone/rclone.conf
echo "region=$RCLONE_ONEDRIVE_REGION" >>~/.config/rclone/rclone.conf
echo "drive_type=$RCLONE_ONEDRIVE_DRIVE_TYPE" >>~/.config/rclone/rclone.conf
echo "token=$RCLONE_ONEDRIVE_TOKEN" >>~/.config/rclone/rclone.conf
echo "drive_id=$RCLONE_ONEDRIVE_DRIVE_ID" >>~/.config/rclone/rclone.conf
fi

if [ ! -z "$GPG_PRIVATE_KEY" ]; then
echo "$GPG_PRIVATE_KEY" | gpg --import
echo "$GPG_PRIVATE_KEY" | gpg --import
fi

cd upload_packages || exit 1
Expand All @@ -30,17 +32,16 @@ python3 $init_path/create-db-and-upload-action/sync.py
#rm "./${repo_name:?}.files.tar.gz"

if [ ! -z "$GPG_PRIVATE_KEY" ]; then
packages=( "*.tar.zst" )
for name in $packages
do
if [ ! -z "$GPG_PASSWORD" ]; then
gpg --batch --passphrase $GPG_PASSWORD --detach-sig --yes $name
repo-add --verify --sign "./${repo_name:?}.db.tar.gz" ./*.tar.zst
ls -al
else
gpg --detach-sig --yes $name
repo-add --verify --sign "./${repo_name:?}.db.tar.gz" ./*.tar.zst
fi
done
packages=("*.tar.zst")
for name in $packages; do
if [ ! -z "$GPG_PASSWORD" ]; then
gpg --batch --passphrase $GPG_PASSWORD --detach-sig --yes $name
repo-add --verify --sign "./${repo_name:?}.db.tar.gz" ./*.tar.zst
ls -al
else
gpg --detach-sig --yes $name
repo-add --verify --sign "./${repo_name:?}.db.tar.gz" ./*.tar.zst
fi
done
fi
rclone copy ./ "onedrive:${dest_path:?}" --copy-links

0 comments on commit afc2954

Please sign in to comment.