diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml new file mode 100644 index 0000000..2eead4e --- /dev/null +++ b/.github/workflows/build-and-release.yaml @@ -0,0 +1,42 @@ +name: Build and release + +on: + push: + branches: [ master ] + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-python@v2 + with: + python-version: '3.9' + - uses: actions/checkout@v2 + - name: Install python requirements + run: pip3 install -r requirements.txt + - name: Pull docker container + run: docker pull thomasweise/docker-texlive-full + - name: Run .pdf build + run: doge build + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./build/main.pdf + asset_name: main.pdf + asset_content_type: application/pdf diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..bdde10c --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,23 @@ +name: Build + +on: + pull_request: + branches: [ master ] + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-python@v2 + with: + python-version: '3.9' + - uses: actions/checkout@v2 + - name: Install python requirements + run: pip3 install -r requirements.txt + - name: Pull docker container + run: docker pull thomasweise/docker-texlive-full + - name: Run .pdf build + run: doge build + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d09d088 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# Virtualenv +venv + +# Build dir +build/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..3552063 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# C++ lections + +## How to build + +### Prerequisites + +You must have installed on your machine: + +- python 3.7 or greater +- docker + +### Installing dogebuild + +This project uses [dogebuild](https://github.com/dogebuild/dogebuild) builder with [dogebuild-tex](https://github.com/dogebuild/dogebuild-tex) plugin. + +To install required python modules you must call: + +```sh +pip install -r requirements.txt +``` + +### Build .pdf + +To build pdf call: + +```sh +doge build +``` + +Builded .pdf will be in `build` directory. diff --git a/dogefile.py b/dogefile.py new file mode 100644 index 0000000..1ae2e63 --- /dev/null +++ b/dogefile.py @@ -0,0 +1,9 @@ +from pathlib import Path + +from dogebuild_tex import Tex, DockerTexBinary + + +Tex( + main_file=Path("cpp_lectures.tex"), + tex_binary=DockerTexBinary("thomasweise/docker-texlive-full"), +) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1148ba3 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,10 @@ +appdirs==1.4.4 +colorlog==4.0.2 +distlib==0.3.1 +dogebuild==0.3.3 +dogebuild-tex==0.1.3 +filelock==3.0.12 +gitsnapshot==0.1.2 +six==1.15.0 +toposort==1.5 +virtualenv==20.4.2