-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (45 loc) · 1.81 KB
/
publish.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
50
51
52
53
54
55
56
name: Publish
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
compile_and_publish:
name: Publish pdfs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Install requirements
run: python3 -m pip install -r requirements.txt
- name: Install LaTex
run: sudo apt-get install -y texlive-base texlive-xetex
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Run generate_release.sh
id: generate_release
run: |
source ./create_release.sh ${{ steps.date.outputs.date }}
echo "::set-output name=ZIP_NAME::$zipname"
# This step reads a file from repo and use it for body of the release
# This works on any self-hosted runner OS
- name: Read README.md and use it as a body of new release
id: read_release
shell: bash
run: |
r=$(cat output/README.md) # <--- Read README.md
r="${r//'%'/'%25'}" # Multiline escape sequences for %
r="${r//$'\n'/'%0A'}" # Multiline escape sequences for '\n'
r="${r//$'\r'/'%0D'}" # Multiline escape sequences for '\r'
echo "::set-output name=RELEASE_BODY::$r"
- name: Upload Binaries to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.date.outputs.date }}
file: ${{ steps.generate_release.outputs.ZIP_NAME }}
release_name: v${{ steps.date.outputs.date }}
body: |
${{ steps.read_release.outputs.RELEASE_BODY }}