-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
2,771 additions
and
594 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: latexmk paper | ||
on: | ||
push: | ||
workflow_dispatch: | ||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}" | ||
cancel-in-progress: true | ||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Git repository | ||
uses: actions/checkout@v4 | ||
- name: Install TeX Live | ||
uses: zauguin/install-texlive@v3 | ||
with: | ||
package_file: '${{ github.workspace }}/Texlivefile' | ||
- name: Prepare latexmk | ||
run: | | ||
updmap -sys | ||
texhash | ||
tlmgr generate language --rebuild-sys | ||
if [ ! -f "latexmkrc" ]; then | ||
cp "_latexmkrc" "latexmkrc" | ||
fi | ||
- run: latexmk paper | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-result | ||
path: | | ||
paper.pdf |
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,11 +1,12 @@ | ||
name: Update Files | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- update-ltg | ||
- main | ||
workflow_dispatch: | ||
concurrency: | ||
group: update-files | ||
group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}" | ||
cancel-in-progress: true | ||
jobs: | ||
generatetex: | ||
|
@@ -21,16 +22,17 @@ jobs: | |
examples: [true] | ||
steps: | ||
- name: Set up Git repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
path: 'code' | ||
- uses: actions/setup-node@v3 | ||
- name: Update npm | ||
run: npm i -g npm@latest | ||
- run: npm i npm@latest | ||
ref: '${{ github.event.pull_request.head.ref }}' | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '22' | ||
cache: 'npm' | ||
cache-dependency-path: 'generator-latex-template/package-lock.json' | ||
- name: Make generator available globally | ||
working-directory: ${{ github.workspace }}/code/generator-latex-template | ||
working-directory: ${{ github.workspace }}/generator-latex-template | ||
run: | | ||
npm install | ||
npm link | ||
|
@@ -40,15 +42,15 @@ jobs: | |
shell: bash | ||
working-directory: /tmp/ltg | ||
run: | | ||
yo latex-template\ | ||
yo $GITHUB_WORKSPACE/generator-latex-template/generators/app/index.js \ | ||
--githubpublish\ | ||
--docker=reitzig\ | ||
--docker=iot\ | ||
--documentclass=lncs\ | ||
--papersize=a4\ | ||
--latexcompiler=pdflatex\ | ||
--latexcompiler=both\ | ||
--bibtextool=bibtex\ | ||
--overleaf=true\ | ||
--texlive=2022\ | ||
--texlive=2024\ | ||
--lang=${{ matrix.language }}\ | ||
--font=${{ matrix.font }}\ | ||
--listings=${{ matrix.listings }}\ | ||
|
@@ -58,7 +60,7 @@ jobs: | |
--examples=${{ matrix.examples }}\ | ||
--howtotext=false | ||
env: | ||
yeoman_test: true | ||
yeoman_test: false | ||
- name: Prepare files | ||
working-directory: /tmp/ltg | ||
run: | | ||
|
@@ -71,83 +73,78 @@ jobs: | |
# remove files which should not be overwritten | ||
# _latexmkrc alternates between including and excluding "--shell-escape"; we just want to keep the minted + en version of it | ||
if [ "${{ matrix.listings }}" != "minted" ] || [ "${{ matrix.lang }}" != "en" ]; then | ||
rm _latexmkrc | ||
rm -r .github/workflows | ||
fi | ||
# the LICENSE of the repository should be kept | ||
rm LICENSE | ||
# _latexmkrc alternates between including and excluding "--shell-escape"; we just want to keep one version of it | ||
rm _latexmkrc | ||
# copy everything | ||
cp -r * ${{ github.workspace }}/code/ | ||
# Files are ready | ||
# Overwrite old versions in $GITHUB_WORKSPACE | ||
cp -r * $GITHUB_WORKSPACE | ||
cp -r .* $GITHUB_WORKSPACE | ||
# output current status | ||
cd ${{ github.workspace }}/code/ | ||
cd ${{ github.workspace }} | ||
git status | ||
git diff | ||
- name: Commit changes | ||
uses: EndBug/add-and-commit@v8 | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
message: 'Update files based on generated files by template generator' | ||
committer_email: [email protected] | ||
push: false | ||
cwd: 'code' | ||
- name: Push changes | ||
run: | | ||
cd code | ||
git status | ||
parallel --retries 10 --delay 9 ::: "git status && git pull --rebase && git push" | ||
parallel --retries 10 --delay 9 ::: "git pull --rebase; git push" | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: [generatetex] | ||
services: | ||
registry: | ||
image: registry:2 | ||
ports: | ||
- 5000:5000 | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
driver-opts: network=host | ||
- name: Build Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: true | ||
provenance: false | ||
tags: localhost:5000/name/app:latest | ||
- name: Set up Git repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: '${{ github.event.pull_request.head.ref }}' | ||
- run: | | ||
# ensure latest updates | ||
git pull | ||
cp paper-en-default-listings.tex paper.tex | ||
cp paper-en-default-minted.tex paper-minted.tex | ||
cp paper-en-times-listings.tex paper-newtx.tex | ||
cp paper-en-times-minted.tex paper-minted-newtx.tex | ||
mkdir /tmp/out | ||
# use latexmkrc (which is disabled due to easy overleaf usage) | ||
cp _latexmkrc latexmkrc | ||
- name: Build paper.tex | ||
run: docker run -v $(pwd):/work/src -v /tmp/out:/work/out localhost:5000/name/app:latest work "latexmk paper.tex" | ||
- name: Build paper-minted.tex | ||
run: docker run -v $(pwd):/work/src -v /tmp/out:/work/out localhost:5000/name/app:latest work "latexmk paper-minted.tex" | ||
- name: Build paper-newtx.tex | ||
run: docker run -v $(pwd):/work/src -v /tmp/out:/work/out localhost:5000/name/app:latest work "latexmk paper-newtx.tex" | ||
- name: Build paper-minted-newtx.tex | ||
run: docker run -v $(pwd):/work/src -v /tmp/out:/work/out localhost:5000/name/app:latest work "latexmk paper-minted-newtx.tex" | ||
- name: Install TeX Live | ||
uses: zauguin/install-texlive@v3 | ||
with: | ||
package_file: '${{ github.workspace }}/Texlivefile' | ||
- name: Prepare latexmk | ||
run: | | ||
updmap -sys | ||
texhash | ||
tlmgr generate language --rebuild-sys | ||
- run: latexmk paper.tex | ||
- run: latexmk paper-minted.tex | ||
- run: latexmk paper-newtx.tex | ||
- run: latexmk paper-minted-newtx.tex | ||
- run: | | ||
mkdir publish | ||
cp /tmp/out/*.pdf publish/ | ||
cp *.pdf publish/ | ||
cp paper.tex publish/ | ||
cp README.md publish/ | ||
cp .github/_config.yml publish/ | ||
- uses: actions/upload-artifact@v2 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: publish | ||
path: publish/ | ||
- name: Deploy | ||
if: github.ref == 'refs/heads/main' | ||
uses: peaceiris/actions-gh-pages@v3 | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./publish | ||
|
Oops, something went wrong.