Merge pull request #403 from hendricius/ebook_build_dir
Some checks failed
Release the book and website / build-and-push-image (push) Waiting to run
Release the book and website / release-book-website (push) Blocked by required conditions
Release the book and website / invalidate-book-website-cache (push) Blocked by required conditions
Test book and website for given image / test-book-website (push) Has been cancelled

Ebook build dir
This commit is contained in:
cedounet
2024-12-28 16:30:54 +00:00
committed by GitHub
3 changed files with 31 additions and 47 deletions

View File

@@ -64,7 +64,7 @@ jobs:
options: -v ${{ github.workspace }}:/app options: -v ${{ github.workspace }}:/app
run: | run: |
cd /app/book cd /app/book
make bake make -j bake
- name: Release baked book to S3 - name: Release baked book to S3
uses: shallwefootball/s3-upload-action@master uses: shallwefootball/s3-upload-action@master
with: with:
@@ -81,14 +81,6 @@ jobs:
book/book_serif/book.log book/book_serif/book.log
book/book_serif/book.pdf book/book_serif/book.pdf
book/book-epub/book.epub book/book-epub/book.epub
- name: Bake the website
uses: addnab/docker-run-action@v3
with:
image: ${{ env.LATEST_IMAGE }}
options: -v ${{ github.workspace }}:/app
run: |
cd /app/book
make mrproper && make website
- name: Release baked website to S3 - name: Release baked website to S3
uses: shallwefootball/s3-upload-action@master uses: shallwefootball/s3-upload-action@master
with: with:

View File

@@ -27,14 +27,14 @@ jobs:
run: | run: |
cd /app/book cd /app/book
make printvars make printvars
- name: Test baking the release versions - name: Test baking the release versions and website
uses: addnab/docker-run-action@v3 uses: addnab/docker-run-action@v3
with: with:
image: ${{ env.DOCKER_IMAGE }} image: ${{ env.DOCKER_IMAGE }}
options: -v ${{ github.workspace }}:/app options: -v ${{ github.workspace }}:/app
run: | run: |
cd /app/book cd /app/book
make -j build_serif_pdf build_ebook make -j build_serif_pdf build_ebook website
- name: Upload book Artifacts - name: Upload book Artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@@ -43,14 +43,6 @@ jobs:
book/book_serif/book.log book/book_serif/book.log
book/book_serif/book.pdf book/book_serif/book.pdf
book/book-epub/book.epub book/book-epub/book.epub
- name: Test building website
uses: addnab/docker-run-action@v3
with:
image: ${{ env.DOCKER_IMAGE }}
options: -v ${{ github.workspace }}:/app
run: |
cd /app/book
make mrproper && make website
- name: Upload website Artifacts - name: Upload website Artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:

View File

@@ -1,7 +1,7 @@
# Macros for commands # Macros for commands
LATEX := latexmk -cd -pdflua -lualatex="lualatex -interaction=nonstopmode" -synctex=1 -use-make LATEX := latexmk -cd -pdflua -lualatex="lualatex -interaction=nonstopmode" -synctex=1 -use-make
EBOOK := tex4ebook --lua -d epub -f epub -c tex4ebook.cfg EBOOK := tex4ebook --lua -d epub -f epub -c tex4ebook.cfg -B epub_build
WEBSITE := make4ht --lua -c website.cfg -a debug -uf html5+tidy+common_domfilters WEBSITE := make4ht --lua -c website.cfg -a debug -uf html5+tidy+common_domfilters -B website_build
CLEAN := latexmk -cd -lualatex -c -use-make CLEAN := latexmk -cd -lualatex -c -use-make
CHECK_1 := lacheck CHECK_1 := lacheck
CHECK_2 := chktex CHECK_2 := chktex
@@ -112,10 +112,10 @@ epub/%.epub: %.tex $(ebook_src) cover/cover-page.xbb
$(EBOOK) $< $(EBOOK) $<
copy_ebook_files: build_ebook copy_ebook_files: build_ebook
$(RSYNC) book-epub/ bw-book-epub/ $(RSYNC) epub_build/book-epub/ bw-book-epub/
copy_ebook_files_cl: build_ebook copy_ebook_files_cl: build_ebook
$(RSYNC) book-epub/ low-res-book-epub/ $(RSYNC) epub_build/book-epub/ low-res-book-epub/
# We do not convert SVG to B&W or lower res for now as they are super small # We do not convert SVG to B&W or lower res for now as they are super small
# anyway # anyway
@@ -247,32 +247,32 @@ spell-check: $(src_tex) spelling_exceptions.txt
# Clean up and delete generated files # Clean up and delete generated files
.PHONY: clean_figures clean_ebook_build clean_website_build clean mrproper .PHONY: clean_figures clean_ebook_build clean_website_build clean mrproper
clean_figures: clean_figures:
- $(CLEAN) $(patsubst %.tex, %.png.in, $(src_figures)) -$(CLEAN) $(patsubst %.tex, %.png.in, $(src_figures))
- rm $(patsubst %.tex, %.png.pdf, $(src_figures)) -rm $(patsubst %.tex, %.png.pdf, $(src_figures))
- rm $(patsubst %.tex, %.png.in, $(src_figures)) -rm $(patsubst %.tex, %.png.in, $(src_figures))
- rm $(wildcard figures/*.png.*) -rm $(wildcard figures/*.png.*)
- rm cover/cover-page.xbb -rm cover/cover-page.xbb
clean_ebook_build: clean_ebook_build:
-rm book*.{4ct,4tc,aux,bbl,bcf,blg,dvi,fdb_latexmk,fls,html} -rm epub_build/book*.{4ct,4tc,aux,bbl,bcf,blg,dvi,fdb_latexmk,fls,html}
-rm book*.{idv,lg,loc,log,ncx,run.xml,tmp,xref} -rm epub_build/book*.{idv,lg,loc,log,ncx,run.xml,tmp,xref}
-rm book*x.svg -rm epub_build/book*x.svg
-rm book.css -rm epub_build/book.css
-rm content.opf -rm epub_build/content.opf
-rm epub_build/book-epub/mimetype
-rm -rf epub_build/book-epub/META-INF
-rm -rf epub_build/book-epub/OEBPS
clean_website_build: clean_ebook_build clean_website_build:
-rm book-*.svg -rm website_build/book*.{4ct,4tc,aux,bbl,bcf,blg,dvi,fdb_latexmk,fls,html}
-rm book.{loc,dlog} -rm website_build/book*.{idv,lg,loc,log,ncx,run.xml,tmp,xref}
-rm $(subst $(website_dir)/,, $(wildcard $(website_dir)/*.html)) -rm website_build/book.{loc,dlog}
clean: clean_ebook_build clean_figures clean_website_build clean: clean_ebook_build clean_figures clean_website_build
$(CLEAN) -output-directory=book_serif book.tex $(CLEAN) -output-directory=book_serif book.tex
$(CLEAN) -output-directory=book_sans_serif book_sans_serif.tex $(CLEAN) -output-directory=book_sans_serif book_sans_serif.tex
$(CLEAN) -output-directory=booklet booklet.tex $(CLEAN) -output-directory=booklet booklet.tex
-rm book*/*.{bbl,loc,.run.xml} -rm book*/*.{bbl,loc,run.xml}
-rm -rf *book-epub/META-INF
-rm -rf *book-epub/OEBPS
-rm *book-epub/mimetype
mrproper: clean mrproper: clean
$(CLEAN) -C $(src_figures) $(CLEAN) -C $(src_figures)
@@ -280,20 +280,20 @@ mrproper: clean
$(CLEAN) -C -output-directory=book_sans_serif book_sans_serif.tex $(CLEAN) -C -output-directory=book_sans_serif book_sans_serif.tex
$(CLEAN) -C -output-directory=booklet booklet.tex $(CLEAN) -C -output-directory=booklet booklet.tex
-rm figures/*.png -rm figures/*.png
-rm *.html
-rm *.svg
-rm -rf epub/ -rm -rf epub/
-rm -rf release/ -rm -rf release/
-rm -rf book_serif/ -rm -rf book_serif/
-rm -rf book_sans_serif/ -rm -rf book_sans_serif/
-rm -rf booklet/ -rm -rf booklet/
-rm -rf *book-epub/ -rm -rf *book-epub/
-rm -rf epub_build/
-rm -rf website_build/
-rm -rf $(website_dir) -rm -rf $(website_dir)
# top level releases rules # top level releases rules
.PHONY: bake release_serif release_sans_serif .PHONY: bake release_serif release_sans_serif
bake: release_serif release_sans_serif release_booklet bake: release_serif release_sans_serif release_booklet website
release: release:
mkdir -p release mkdir -p release
@@ -321,7 +321,7 @@ html: $(website_dir)/book.html
# Because packages will be installed in hard to predict places use a file as # Because packages will be installed in hard to predict places use a file as
# marker.. # marker..
../website/_bundle_install_done: $(ruby_pkg) ../website/_bundle_install_done: $(ruby_pkg)
- rm ../website/$@ -rm ../website/$@
cd ../website && bundle install cd ../website && bundle install
touch ../website/$@ touch ../website/$@