Skip to content

Commit

Permalink
Merge pull request #2 from feelpp/1-add-workflow
Browse files Browse the repository at this point in the history
resolves 1: add workflow
  • Loading branch information
prudhomm authored Jul 17, 2024
2 parents a9f1ff9 + 9e7ff78 commit c573f6a
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/latex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,37 @@ on:
jobs:
build_latex:
runs-on: self-ubuntu-24.04
outputs:
prefix: ${{ steps.repo_name.outputs.prefix }}
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v3
with:
root_file: main.tex
post_compile: |
mv main.pdf ${{ github.repository }}.pdf
- name: Get Repository Name
id: repo_name
run: |
ls -lrt
prefix=$(echo "${{ github.repository }}" | cut -d'/' -f2)
echo "prefix=$prefix" >> "$GITHUB_OUTPUT"
echo "pdf=$prefix-v${{ github.ref_name }}.pdf" >> "$GITHUB_OUTPUT"
-
name: Rename PDF
run: |
mv main.pdf ${{ steps.repo_name.outputs.pdf }}
- name: Upload PDF
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.1.0
with:
name: ${{ github.repository }}.pdf
path: .
# get the name of the repo without the organisation
name: PDF
path: ${{ steps.repo_name.outputs.pdf }}

release:
runs-on: ubuntu-latest
needs: build_latex
env:
veersionedpdf: ${{ github.repository }}-v${{ github.ref_name }}.pdf
steps:
- name: Download PDF
uses: actions/download-artifact@v4
with:
name: ${{ github.repository }}.pdf
- name: Rename to add version
run: mv ${{ github.repository }}.pdf ${{ env.veersionedpdf}}
- name: Create Release
if: startsWith(github.ref ,'refs/tags/v')
needs: build_latex
-
name: Create Release
id: create_release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
draft: false
Expand All @@ -53,4 +53,4 @@ jobs:
tag_name: ${{ github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
files: |
${{ env.veersionedpdf }}
${{ steps.repo_name.outputs.pdf }}

0 comments on commit c573f6a

Please sign in to comment.