separate files #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate Release PDF | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '.github/**' | |
- '.gitignore' | |
- '**.md' | |
env: | |
TEX_FILE_NAME: algebraic_construction | |
jobs: | |
build_latex: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v3 | |
- name: Compile LaTeX document | |
uses: xu-cheng/latex-action@v2 | |
with: | |
root_file: ${{ env.TEX_FILE_NAME }}.tex | |
- name: Delete old Release | |
uses: actions/github-script@v5 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const { owner, repo } = context.repo | |
try { | |
const { data: { id } } = await github.rest.repos.getLatestRelease({ owner, repo }) | |
await github.rest.repos.deleteRelease({ owner, repo, release_id: id }) | |
} catch {} | |
- name: Generate release tag | |
id: tag | |
run: | | |
echo "::set-output name=release_tag::latest_$(date +"%Y-%m-%d_%H-%M")" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: latest version | |
body: Latest version of `${{ env.TEX_FILE_NAME }}.pdf` | |
tag_name: ${{ steps.tag.outputs.release_tag }} | |
files: ${{ env.TEX_FILE_NAME }}.pdf |