forked from rrthomas/hpmor
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update check-and-ebook.yml
- Loading branch information
Showing
2 changed files
with
58 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,68 @@ | ||
name: Build eBooks | ||
# This workflow runs upon new commits and PRs | ||
# 1. checks | ||
# 1.1 chapter quality check for known issues | ||
# 1.2 python code quality checks | ||
|
||
name: Check and Make eBook | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
# permissions: | ||
# contents: read | ||
|
||
jobs: | ||
build: | ||
# | ||
# check source code | ||
# | ||
check: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Print start date | ||
run: date +%Y-%m-%d_%H:%M | ||
- name: checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
fetch-depth: 1 # 0 if you want to push to repo | ||
|
||
- name: python set up | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
# cache: "pip" | ||
|
||
- name: Checkout repository | ||
- name: python cache set up | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: python-${{ env.pythonLocation }} | ||
|
||
- name: check chapters for known issues | ||
run: python3 -O scripts/check_chapters.py | ||
|
||
- name: check pre-commit hooks | ||
uses: pre-commit/[email protected] | ||
|
||
# | ||
# make eBook | ||
# | ||
make: | ||
needs: check | ||
if: github.event_name != 'pull_request' | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
fetch-depth: 1 # 0 if you want to push to repo | ||
|
||
- name: Python set up | ||
- name: python set up | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
@@ -29,27 +73,24 @@ jobs: | |
# cd /usr/share/locales | ||
# sudo ./install-language-pack de_DE.UTF-8 | ||
|
||
- name: Test ls before | ||
- name: ls before | ||
run: | | ||
pwd | ||
ls -l | ||
- name: Check chapters for known issues | ||
run: python3 -O scripts/check_chapters.py | ||
|
||
# - name: Install requirements | ||
# - name: install packages | ||
# run: | | ||
# # sudo apt update > /dev/null | ||
# sh scripts/install_requirements_ebook.sh > /dev/null | ||
|
||
- name: Install packages using cache | ||
- name: install packages using cache | ||
uses: awalsh128/cache-apt-pkgs-action@latest | ||
with: | ||
packages: texlive-extra-utils pandoc calibre imagemagick ghostscript | ||
version: 1.0 | ||
# execute_install_scripts: true | ||
|
||
- name: Print versions | ||
- name: print versions | ||
run: | | ||
cat /etc/os-release | ||
# xelatex -v | ||
|
@@ -61,17 +102,17 @@ jobs: | |
# - name: Check pre-commit tests | ||
# uses: pre-commit/[email protected] | ||
|
||
- name: Make eBooks | ||
- name: make eBooks | ||
run: | | ||
wget --quiet https://github.com/entorb/hpmor-de/releases/download/WorkInProgress/hpmor.pdf -O hpmor.pdf | ||
sh scripts/make_ebooks.sh > /dev/null | ||
- name: Test ls after | ||
- name: ls after | ||
run: | | ||
pwd | ||
ls -l | ||
- name: Publish eBooks to release | ||
- name: publish eBooks to release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
tag_name: WorkInProgress | ||
|
@@ -82,6 +123,3 @@ jobs: | |
./hpmor.epub | ||
./hpmor.mobi | ||
./hpmor.fb2 | ||
- name: Print end date | ||
run: date +%Y-%m-%d_%H:%M |
This file was deleted.
Oops, something went wrong.