-
-
Notifications
You must be signed in to change notification settings - Fork 15
100 lines (98 loc) · 2.93 KB
/
test_build_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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Check, Full Build and Publish
on:
push:
branches:
- 'release'
- '0*'
- '1*'
- '2*'
- '3*'
- '4*'
- '5*'
- '6*'
- '7*'
- '8*'
- '9*'
paths:
- '**.po'
- '**.rst'
- '**.txt'
- '**/images/*'
- '_static/**'
- '_templates/**'
- 'setup.py'
- 'conf.py'
- 'tag_mapping.py'
jobs:
lint_rst_and_full_build_and_publish:
name: Check with LintRST, Full Build and Publish
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint Test RST Files
run: python ./setup.py test rst
- name: Setup for Build
run: |
export SPHINXBUILD=`which sphinx-build`
mkdir _build
mkdir docs
- name: Build Tag Map Files
run: |
python ./setup.py build map
# - name: Update Translation Files
# run: |
# python ./setup.py build pot
- name: Build HTML Files
run: |
python ./setup.py clean html
python ./setup.py -l all build html
- name: Build EPUB Files
run: |
python ./setup.py clean epub
python ./setup.py -l all build epub
- name: Install LaTeX dependencies
run: |
sudo apt-get update
sudo apt-get install latexmk
sudo apt-get install xzdec
sudo apt-get install texlive
sudo apt-get install texlive-fonts-extra
sudo apt-get install texlive-latex-extra
sudo apt-get install texlive-luatex
sudo apt-get install xindy
- name: Build PDF Files
run: |
python ./setup.py clean pdf
python ./setup.py -l all build pdf
- name: Add Environment Variables to Variables File
run: |
echo "GITHUB_REF = '${GITHUB_REF}'" >> docs/__init__.py
echo "GITHUB_HEAD_REF = '${GITHUB_HEAD_REF}'" >> docs/__init__.py
- name: Display Variables Passed to Publish Action
run: |
cat docs/__init__.py
- name: Checkout gh-pages branch
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git checkout --force gh-pages
- name: Update gh-pages branch
run: |
python publish.py
git add -A
if grep -q "Changes to be committed:" <<< `git status`; then
git status && git commit -m "Based on ${GITHUB_EVENT_NAME} to ${GITHUB_REF} by ${GITHUB_ACTOR}" && git push origin gh-pages
fi
git checkout master