-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (44 loc) · 1.32 KB
/
generate_release_pdf.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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