Skip to content

Commit

Permalink
Upload built book artifacts using github-supported method
Browse files Browse the repository at this point in the history
  • Loading branch information
Songtech-0912 committed Jan 7, 2025
1 parent c72aee7 commit 838b60b
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,27 @@ jobs:
cd ./book/_build/latex/
echo "Entered LaTeX folder, preparing to build PDF"
make
echo "PDF build successful, uploading artifacts now"
- name: Show debug logs and return to repo root
# Output build artifacts for debugging
- uses: actions/upload-artifact@v4
continue-on-error: true
run: |
echo $(pwd)
# show debug logs
cat elara-handbook.log # debug
# move built book out of build folder
mv elara-handbook.pdf ../../elara-handbook.pdf
with:
path: ./book/_build/latex/elara-handbook.log
compression-level: 0

- name: Output build artifacts for debugging
run: |
# we use temp.sh, a temporary file host service
echo "PDF build log"
curl -F "file=@book/_build/latex/elara-handbook.log" https://temp.sh/upload
echo "TeX generated (may be incomplete)"
curl -F "file=@book/_build/latex/elara-handbook.tex" https://temp.sh/upload
echo "PDF generated (may be incomplete)"
curl -F "file=@book/_build/latex/elara-handbook.pdf" https://temp.sh/upload
- uses: actions/upload-artifact@v4
continue-on-error: true
with:
path: ./book/_build/latex/elara-handbook.tex
compression-level: 0

- uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: elara-handbook-debug-pdf
path: ./book/_build/latex/elara-handbook.pdf
compression-level: 0

- name: Upload book PDF to Github releases
env:
Expand All @@ -100,4 +102,4 @@ jobs:
--tag_name v0.0.0-$(git rev-parse HEAD | cut -c 1-8) \
--prerelease \
--body_string "Automatically generated from book sources via Github Actions" \
./book/elara-handbook.pdf
./book/_build/latex/elara-handbook.pdf

0 comments on commit 838b60b

Please sign in to comment.