forked from jackolney/travis-ci-latex-pdf
-
-
Notifications
You must be signed in to change notification settings - Fork 23
49 lines (46 loc) · 1.82 KB
/
release-pdf-on-tag.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
45
46
47
48
49
# This workflow builds a pdf, and when a tag is pushed then the pdf is released to GitHub releases
name: Release pdf on tag
on: [push]
env:
FILE: main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Compile
run: docker run --mount src=$GITHUB_WORKSPACE/src,target=/usr/src/tex,type=bind dxjoke/tectonic-docker /bin/sh -c "tectonic $FILE.tex"
- name: Upload pdf
uses: actions/upload-artifact@v2
with:
name: main.zip
path: src/*.pdf
- name: Create Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
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: Prepare output path and output name
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
id: prepare_metadata
# upload-release-asset does not support wildcards or environment variables at the moment
run: |
echo ::set-output name=ARTIFACT_PATH::./src/$FILE.pdf
echo ::set-output name=ARTIFACT_NAME::$FILE.pdf
- name: Upload Release Asset
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.prepare_metadata.outputs.ARTIFACT_PATH }}
asset_name: ${{ steps.prepare_metadata.outputs.ARTIFACT_NAME }}
asset_content_type: application/pdf