-
Notifications
You must be signed in to change notification settings - Fork 37
78 lines (64 loc) · 1.97 KB
/
main.yaml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
name: 'EBBR CI Build'
# yamllint disable-line rule:truthy
on:
push:
branches: '**'
tags: 'v*'
pull_request:
branches: main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# checkout@v3 doesn't preserve annotations when fetching the tag
# Forcing the tags to be fetched fixes it so the version is correct
- name: 'Identify Version'
run: |
git fetch --force --tags
echo "EBBR_VERSION=$(git describe)" >> $GITHUB_ENV
- name: 'Install Debian required packages'
run: |
sudo apt update
sudo apt install python3-pip latexmk libalgorithm-diff-perl texlive \
texlive-latex-extra texlive-humanities flake8 mypy
- name: 'Install Python required packages'
run: |
pip3 install --user mako
pip3 install --user typing
pip3 install --user Sphinx
- name: 'Check'
run: make check
- name: 'Build PDF'
run: |
make latexpdf
cp build/latex/ebbr.pdf build/ebbr-${{ env.EBBR_VERSION }}.pdf
- name: 'Build HTML'
run: make html
- name: 'Build Single HTML'
run: make singlehtml
- name: 'Upload artifacts'
uses: actions/upload-artifact@v3
with:
name: ebbr-${{ env.EBBR_VERSION }}
path: |
build/ebbr-*.pdf
build/html/
build/singlehtml/
- name: 'Deploy to Github Pages'
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/singlehtml
- name: 'Publish Release'
uses: softprops/action-gh-release@v1
if: endsWith(github.ref, env.EBBR_VERSION)
with:
files: build/ebbr-*.pdf
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}