diff --git a/.github/workflows/books.sh b/.github/workflows/books.sh new file mode 100644 index 00000000..60d21b3a --- /dev/null +++ b/.github/workflows/books.sh @@ -0,0 +1,15 @@ +#!/bin/bash +DIR_DOWNLOADS="downloads" +echo "Making ebooks ..." + +sudo apt-get install pandoc + +pandoc -o $DIR_DOWNLOADS/typescript-book.epub --metadata title="The Concise TypeScript Book" --metadata author="Simone Poggiali" -s README.md +pandoc -o $DIR_DOWNLOADS/typescript-book-zh_CN.epub --metadata title="# 简洁的TypeScript之书" --metadata author="Simone Poggiali" -s README-zh_CN.md + +git config user.name "GitHub Actions Bot" +git config user.email "<>" + +git add -A +git commit -m 'Automatically add books' +git push \ No newline at end of file diff --git a/.github/workflows/validate-content.yml b/.github/workflows/validate-content.yml index 549ef1c2..a8e2ecfa 100644 --- a/.github/workflows/validate-content.yml +++ b/.github/workflows/validate-content.yml @@ -14,5 +14,11 @@ jobs: - uses: actions/checkout@v3 - name: Run compile script run: bash ${GITHUB_WORKSPACE}/.github/workflows/compile.sh + make-books: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: make books + run: bash ${GITHUB_WORKSPACE}/.github/workflows/books.sh \ No newline at end of file diff --git a/downloads/typescript-book-zh_CN.epub b/downloads/typescript-book-zh_CN.epub index 7bc7a8e9..74baf1ff 100644 Binary files a/downloads/typescript-book-zh_CN.epub and b/downloads/typescript-book-zh_CN.epub differ diff --git a/downloads/typescript-book.epub b/downloads/typescript-book.epub index dedff2c4..f9650862 100644 Binary files a/downloads/typescript-book.epub and b/downloads/typescript-book.epub differ diff --git a/downloadsXXX/typescript-book-zh_CN.epub b/downloadsXXX/typescript-book-zh_CN.epub new file mode 100644 index 00000000..93f6bbce Binary files /dev/null and b/downloadsXXX/typescript-book-zh_CN.epub differ diff --git a/downloadsXXX/typescript-book.epub b/downloadsXXX/typescript-book.epub new file mode 100644 index 00000000..aa2fde41 Binary files /dev/null and b/downloadsXXX/typescript-book.epub differ