From 915e5eca732632bee78048c9f4cd1abfdef38dba Mon Sep 17 00:00:00 2001 From: Torben <59419684+entorb@users.noreply.github.com> Date: Mon, 2 May 2022 21:55:46 +0200 Subject: [PATCH] initial commit --- .github/workflows/build.yml | 56 +++++++++++++++++++++++++++++++++++++ install_requirements.sh | 7 +++++ make_ebooks.sh | 4 +++ make_pdfs.sh | 10 +++++++ 4 files changed, 77 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 install_requirements.sh create mode 100644 make_ebooks.sh create mode 100644 make_pdfs.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..527183ff --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,56 @@ +name: Build HPMOR PDFs and eBooks + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + workflow_dispatch: + push: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + job1: + # runs-on: ubuntu-latest + runs-on: ubuntu-20.04 + steps: + +# Initialize + - name: print start date + run: | + date +%Y-%m-%d_%H:%M + + - name: Checkout Repository + uses: actions/checkout@v2 + with: + persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token + fetch-depth: 0 # otherwise, you will failed to push refs to dest repo + + - name: Python setup + uses: actions/setup-python@v2 + with: + python-version: '3.9' + + - name: Install requirements + run: install_requirements.sh + +# Build + - name: Build PDFs + run: ./make_pdfs.sh + + - name: Build ebooks + run: ./make_ebooks.sh + +# Publish to release + - name: Upload to release + uses: softprops/action-gh-release@v1 + with: + tag_name: MyPrereleaseTag + prerelease: true + files: + ./*.pdf + ebook/output/hpmor.epub + ebook/output/hpmor.mobi + + - name: print end date + run: | + date +%Y-%m-%d_%H:%M diff --git a/install_requirements.sh b/install_requirements.sh new file mode 100644 index 00000000..41ed0a16 --- /dev/null +++ b/install_requirements.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# pdf +sudo apt install texlive-xetex latexmk + +# ebook +sudo apt install calibre diff --git a/make_ebooks.sh b/make_ebooks.sh new file mode 100644 index 00000000..5394a782 --- /dev/null +++ b/make_ebooks.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +cd ebook +./1_latex2html.py && ./2_html2epub.sh diff --git a/make_pdfs.sh b/make_pdfs.sh new file mode 100644 index 00000000..64f09c17 --- /dev/null +++ b/make_pdfs.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# TODO +# latexmk hpmor +latexmk hpmor-1 +# latexmk hpmor-2 +# latexmk hpmor-3 +# latexmk hpmor-4 +# latexmk hpmor-5 +# latexmk hpmor-6