From 86fb93046175f11ab6b62496850ae303436dd9a3 Mon Sep 17 00:00:00 2001 From: Yu-Chun Lin Date: Thu, 4 Apr 2024 10:56:26 +0800 Subject: [PATCH] Add workflow for generating PDFs The workflow generates PDFs using LaTeX with texlive-base, pygments and other dependency.It creates a release on push events, uploading concurrency-primer.pdf as a release for easy accessibility. --- .github/workflows/main.yml | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..83dd116 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,42 @@ +name: generate-pdf-actions +on: [push] +jobs: + concurrency-primer: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + continue-on-error: true + - name: install-texlive + run: | + sudo apt-get install -q -y texlive-full texlive-latex-base + shell: bash + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: install-pygments + run: | + python -m pip install --upgrade pip + pip install pygments + - name: make + run: make + - name: create Release + id: create_Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + release_name: Release ${{ github.ref_name }} + body: | + Changes in this Release + - 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 }} + asset_path: ./concurrency-primer.pdf + asset_name: concurrency-primer.pdf + asset_content_type: application/pdf + \ No newline at end of file