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
on: [push] | |
jobs: | |
create_draft_release: | |
runs-on: ubuntu-latest | |
outputs: | |
id: ${{ steps.create_draft_release.outputs.id }} | |
steps: | |
- name: Create draft release on tags | |
id: create_draft_release | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
uses: actions/create-release@v1.1.4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: true | |
prerelease: false | |
latex-job: | |
needs: create_draft_release | |
runs-on: ubuntu-latest | |
name: Compile And Upload PDF | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: set git user | |
run: | | |
git config --global user.name github-actions | |
git config --global user.email github-actions-bot@users.noreply.github.com | |
- name: define env | |
run: | | |
echo "GITHUB_TAG=$(git describe --always --tags)" >> $GITHUB_ENV | |
echo "BUILD_DATE=$(date +'%Y_%m_%d')" >> $GITHUB_ENV | |
- name: prepare env | |
run: | | |
sudo apt update | |
sudo apt install fonts-opendyslexic fonts-texgyre texlive-bibtex-extra texlive-luatex texlive-latex-recommended texlive-latex-base texlive-latex-extra texlive-fonts-extra texlive-science poppler-utils | |
sudo rm -rf /usr/share/fonts/woff/opendyslexic | |
sudo fc-cache | |
- name: compile | |
run: | | |
lualatex -interaction=nonstopmode -shell-escape hm.tex || true | |
lualatex -interaction=nonstopmode -shell-escape hm.tex || true | |
bibtex hm | |
makeindex hm | |
lualatex -interaction=nonstopmode -shell-escape hm.tex || true | |
lualatex -interaction=nonstopmode -shell-escape hm.tex | |
- name: rename tg | |
run: | | |
mkdir assets | |
mv hm.pdf assets/hm-tg.pdf | |
# - name: upload PDF | |
# if: ${{ success() }} | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# path: assets/hm-tg.pdf | |
# name: hm-tg-${{ env.BUILD_DATE }}-${{ env.GITHUB_TAG }}.pdf | |
# if-no-files-found: error | |
- name: use OpenDyslxic | |
run: git apply ci0.patch | |
- name: compile again | |
run: | | |
lualatex -interaction=nonstopmode -shell-escape hm.tex || true | |
bibtex hm | |
makeindex hm | |
lualatex -interaction=nonstopmode -shell-escape hm.tex || true | |
lualatex -interaction=nonstopmode -shell-escape hm.tex | |
- name: rename od | |
run: mv hm.pdf assets/hm-od.pdf | |
# - name: upload PDF | |
# if: ${{ success() }} | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# path: assets/hm-tg.pdf | |
# name: hm-tg-${{ env.BUILD_DATE }}-${{ env.GITHUB_TAG }}.pdf | |
# if-no-files-found: error | |
- name: upload assets | |
if: ${{ success() && startsWith(github.ref, 'refs/tags/') }} | |
id: upload-release-assets | |
uses: dwenegar/upload-release-assets@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_id: ${{ needs.create_draft_release.outputs.id }} | |
assets_path: assets/ | |
- name: remove font customization for html version | |
run: git apply ci1.patch | |
- name: compile html | |
run: | | |
lwarpmk html | |
lwarpmk limages | |
bibtex hm_html | |
lwarpmk printindex | |
lwarpmk html1 | |
- name: prepare for deployment | |
run: | | |
mkdir public | |
mv hm-images/ images/ chapter*.html index.html *.css public/ | |
- name: deploy release | |
if: ${{ success() && startsWith(github.ref, 'refs/tags/') }} | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
personal_token: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
publish_branch: master | |
publish_dir: ./public |