From ec3011fc3000ebd942acd2b0db963ed35f880812 Mon Sep 17 00:00:00 2001 From: Kirill Sulim Date: Fri, 5 Feb 2021 02:01:03 +0500 Subject: [PATCH 1/3] doge buid successfully builds document --- .gitignore | 5 +++++ README.md | 30 ++++++++++++++++++++++++++++++ dogefile.py | 9 +++++++++ requirements.txt | 10 ++++++++++ 4 files changed, 54 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 dogefile.py create mode 100644 requirements.txt 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 From fc91fffab45e951a0c9564cc8ec47fd37822db03 Mon Sep 17 00:00:00 2001 From: Kirill Sulim Date: Fri, 5 Feb 2021 02:14:52 +0500 Subject: [PATCH 2/3] Add actions --- .github/workflows/build-and-release.yaml | 42 ++++++++++++++++++++++++ .github/workflows/build.yaml | 23 +++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 .github/workflows/build-and-release.yaml create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml new file mode 100644 index 0000000..eb0efa4 --- /dev/null +++ b/.github/workflows/build-and-release.yaml @@ -0,0 +1,42 @@ +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 + - 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: ./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 + From cb2a6d61ba812d766993acfc2c45980777907e4d Mon Sep 17 00:00:00 2001 From: Kirill Sulim Date: Fri, 5 Feb 2021 02:21:12 +0500 Subject: [PATCH 3/3] Fix build file --- .github/workflows/build-and-release.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index eb0efa4..2eead4e 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -1,7 +1,7 @@ -name: Build +name: Build and release on: - pull_request: + push: branches: [ master ] workflow_dispatch: @@ -37,6 +37,6 @@ jobs: 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: ./main.pdf + asset_path: ./build/main.pdf asset_name: main.pdf asset_content_type: application/pdf