-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add missing fonts and make necessary changes in the .tex file. * Add Github action workflow file. * Cut building time by at least 4. * Add more information.
- Loading branch information
Showing
20 changed files
with
117 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,115 @@ | ||
name: Build | ||
|
||
on: | ||
- push | ||
|
||
jobs: | ||
dependencies: | ||
name: Build dependencies | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.version.outputs.version }} | ||
|
||
steps: | ||
- name: Set up Git repository | ||
uses: actions/checkout@v1 | ||
|
||
- name: Create global variables | ||
id: version | ||
run: echo "::set-output name=version::$(git rev-parse --short HEAD)" | ||
|
||
build: | ||
name: Build documents | ||
needs: dependencies | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
sources: | ||
- input: ctfp-print.tex | ||
output: ctfp-print.pdf | ||
- input: ctfp-reader.tex | ||
output: ctfp-reader.pdf | ||
- input: ctfp-print-scala.tex | ||
output: ctfp-print-scala.pdf | ||
- input: ctfp-reader-scala.tex | ||
output: ctfp-reader-scala.pdf | ||
- input: ctfp-reader-ocaml.tex | ||
output: ctfp-reader-ocaml.pdf | ||
- input: ctfp-print-ocaml.tex | ||
output: ctfp-print-ocaml.pdf | ||
|
||
steps: | ||
- name: Set up Git repository | ||
uses: actions/checkout@v1 | ||
|
||
- name: Create necessary build file (version.tex) | ||
run: | | ||
echo -n -e "\\\newcommand{\OPTversion}{$(git rev-parse --short HEAD)}" > src/version.tex | ||
- name: Build documents using LaTeX (${{ matrix.sources.input }}) | ||
uses: xu-cheng/latex-action@v2 | ||
with: | ||
working_directory: src | ||
latexmk_use_xelatex: true | ||
root_file: ${{ matrix.sources.input }} | ||
latexmk_shell_escape: true | ||
|
||
- name: Upload build assets (${{ matrix.sources.output }}) | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.sources.output }} | ||
path: src/${{ matrix.sources.output }} | ||
|
||
release: | ||
name: "Create Github tag/pre-release" | ||
runs-on: ubuntu-latest | ||
needs: [dependencies,build] | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
steps: | ||
- name: Create Github pre-release (${{ needs.dependencies.outputs.version }}) | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ needs.dependencies.outputs.version }} | ||
release_name: Version ${{ needs.dependencies.outputs.version }} | ||
draft: false | ||
prerelease: true | ||
|
||
assets: | ||
name: Upload release assets | ||
runs-on: ubuntu-latest | ||
needs: [dependencies,release] | ||
strategy: | ||
matrix: | ||
assets: | ||
- source: ctfp-print.pdf | ||
destination: category-theory-for-programmers--print-- | ||
- source: ctfp-reader.pdf | ||
destination: category-theory-for-programmers-- | ||
- source: ctfp-print-scala.pdf | ||
destination: category-theory-for-programmers--print--scala-- | ||
- source: ctfp-reader-scala.pdf | ||
destination: category-theory-for-programmers--reader--scala-- | ||
- source: ctfp-print-ocaml.pdf | ||
destination: category-theory-for-programmers--print--ocaml-- | ||
- source: ctfp-reader-ocaml.pdf | ||
destination: category-theory-for-programmers--reader--ocaml-- | ||
steps: | ||
- name: Download build assets (${{ matrix.assets.source }}) | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: ${{ matrix.assets.source }} | ||
path: ${{ matrix.assets.source }} | ||
|
||
- name: Upload release assets (${{ matrix.assets.destination }}${{ needs.dependencies.outputs.version }}.pdf) | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.release.outputs.upload_url }} | ||
asset_path: ${{ matrix.assets.source }}/${{ matrix.assets.source }} | ||
asset_name: ${{ matrix.assets.destination }}${{ needs.dependencies.outputs.version }}.pdf | ||
asset_content_type: application/pdf |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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