diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..ed41f555 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,32 @@ +name: 'build' +on: + pull_request: + push: +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out code base + if: github.event_name == 'push' + uses: actions/checkout@v2.3.1 + with: + fetch-depth: 0 + + - name: Check out code base + if: github.event_name == 'pull_request' + uses: actions/checkout@v2.3.1 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + + - uses: cachix/install-nix-action@v12 + with: + nix_path: nixpkgs=channel:nixos-unstable + - run: NIXPKGS_ALLOW_UNFREE=1 nix-build + - name: "Copy book" + run: "cp result/share/book.pdf ." + - name: "Upload artifact to GitHub" + uses: actions/upload-artifact@v2 + with: + name: book.pdf + path: book.pdf diff --git a/default.nix b/default.nix new file mode 100644 index 00000000..1d0eef24 --- /dev/null +++ b/default.nix @@ -0,0 +1,30 @@ +with import {}; + +stdenv.mkDerivation rec { + name = "math-comp-book"; + version = "master"; + src = ./.; + + nativeBuildInputs = [ git texlive.combined.scheme-full ]; + + buildPhase = '' + cd tex + make + biber main + make + make + ''; + + installPhase = '' + mkdir -p $out/share + cp book.pdf $out/share + ''; + + meta = with lib; { + description = "Mathematical components book"; + homepage = "https://github.com/math-comp/mcb"; + license = lib.licenses.cc-by-nc-40; + maintainers = with maintainers; [ siraben ]; + platforms = platforms.all; + }; +} diff --git a/tex/Makefile b/tex/Makefile index c9320917..c9139075 100644 --- a/tex/Makefile +++ b/tex/Makefile @@ -12,7 +12,7 @@ all: gitrev gitrev: date -R > gitrev echo , >> gitrev - git describe --tags >> gitrev + if [ -d ../.git ]; then git describe --tags >> gitrev; fi clean: rm -rf .*/rt *.aux *.bbl *.bcf *.idx *.out *.toc *.ilg *.ind *.listing *.ptc *.run.xml diff --git a/tex/ch0.tex b/tex/ch0.tex index d4df705a..78c08186 100644 --- a/tex/ch0.tex +++ b/tex/ch0.tex @@ -47,11 +47,12 @@ \chapter*{Introduction} and the last chapter of this book. We wish to thank Reynald Affeldt, Guillaume Allais, Sophie Bernard, Simon Boulier, Cyril Cohen, Arthur Charguéraud, Alain Giorgetti, Darij Grinberg, Florent Hivert, Pierre -Jouvelot, Marisa Kirisame, Andrey Klaus, Guillaume Melquiond, Sebastian Miele, -Yamamoto Mitsuharu, Prashanth Mundkur, Michael Nahas, Julien Narboux, -Laurence Rideau, Lionel Rieg, Damien Rouhling, Michael Soegtrop, -Laurent Théry, and Anton Trunov for their careful proofreading and for -their suggestions. Many thanks to Hanna for the illustrations. +Jouvelot, Marisa Kirisame, Andrey Klaus, Guillaume Melquiond, +Sebastian Miele, Yamamoto Mitsuharu, Prashanth Mundkur, Michael Nahas, +Julien Narboux, Siraphob (Ben) Phipathananunth, Laurence Rideau, +Lionel Rieg, Damien Rouhling, Michael Soegtrop, Laurent Théry, and +Anton Trunov for their careful proofreading and for their +suggestions. Many thanks to Hanna for the illustrations. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section*{Structure of the book}