Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
runbing committed Jun 1, 2024
1 parent aa23158 commit 35643c0
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/calibre-news.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,20 +120,26 @@ jobs:
if [ $count -eq 0 ]; then
echo 'No ebook needs send'; exit 1
fi
mkdir ebooks
mv *.${ext,,} ebooks
- name: Sending Ebook
if: ${{ success() }}
run: |
while read -d '' ebook_path; do
filename="$(basename "$ebook_path")"
title="${filename%.*}"
echo "Sending: \"$filename\""
calibre-smtp -a "${filename}" -r "$relay" --port="$port" \
-e "${encrypt^^}" -u "$from" -p "$secret" -s "$title" \
"$from" "$to" "Deliver \"${title}\""
size=$(du -m "$ebook_path" | cut -f 1)
if [ $size -lt 25 ]; then
filename="$(basename "$ebook_path")"
title="${filename%.*}"
echo "Sending: \"$filename\""
calibre-smtp -a "${filename}" -r "$relay" --port="$port" \
-e "${encrypt^^}" -u "$from" -p "$secret" -s "$title" \
"$from" "$to" "Deliver \"${title}\""
fi
done < <(find . -maxdepth 1 -type f -name "*.${ext,,}" -print0)
echo "All jobs done"
- name: Collecting Ebook
if: ${{ success }}
run: |
mkdir ebooks
mv *.${ext,,} ebooks
- name: Storing Ebook
if: ${{ success() }}
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 35643c0

Please sign in to comment.