-
Notifications
You must be signed in to change notification settings - Fork 16
177 lines (146 loc) · 4.97 KB
/
main.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: build_specification
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ created ]
jobs:
build_latex:
runs-on: ubuntu-latest
needs: build_sampler
steps:
- name: Set up Git repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install dependencies
run: |
npm install markdown-pdf
sudo apt install git-restore-mtime
- name: Reset file modification times
run: git restore-mtime
- name: Generate PDFs for glyphs
run: python3 scripts/rebuild_glyphs.py
- name: Generate tex file for examples appendix
run: |
cd scripts
python3 generate_examples_appendix.py
- name: Compile LaTeX document
uses: dante-ev/[email protected]
with:
working_directory: specification
root_file: sbolvisual.tex
- name: Move PDF
run: mkdir -p output && cp specification/sbolvisual.pdf output
- name: Upload PDF as build artifact
uses: actions/[email protected]
with:
name: PDF
path: output
- if: github.event_name == 'release'
name: Upload PDF as release artifact
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: output/sbolvisual.pdf
- if: ${{ github.event_name == 'push' }}
name: Commit glyph PDFs, ready to push
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add specification/glyphscript/Glyphs/
git diff-index --quiet HEAD specification/glyphscript/Glyphs/ || git commit -m "Automatically update PDFs for individual glyphs"
- name: Push changes
if: ${{ github.event_name == 'push' }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_sampler:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v1
- name: Install dependencies
run: |
sudo apt-get install libcairo2-dev build-essential python3-setuptools
cd scripts
pip3 install -r requirements.txt
- name: Build samplers
run: python3 scripts/generate_sampler.py
- name: Upload samplers as artifact
uses: actions/[email protected]
with:
name: samplers
path: sampler
- name: Commit sampler file
if: ${{ github.event_name == 'push' }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add sampler/
git diff-index --quiet HEAD || git commit -m "Automatically re-generate sampler"
- name: Push changes
if: ${{ github.event_name == 'push' }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Compress samplers
run: zip -j samplers sampler/*
- if: github.event_name == 'release'
name: Upload sampler as release artifact
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: samplers.zip
build_glph_zipfiles:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v1
- name: Install dependencies
run: |
sudo apt-get install libcairo2-dev build-essential python3-setuptools
cd scripts
pip3 install -r requirements.txt
- name: Make directories
run: |
mkdir -p glyph_collections/svg
mkdir -p glyph_collections/pdf
mkdir -p glyph_collections/png
- name: Make collections of glyphs
run: python3 scripts/collate_glyphs.py
- name: Upload zipfile of SVGs
uses: actions/[email protected]
with:
name: SVG Glyphs
path: glyph_collections/svg
- name: Upload zipfile of PDFs
uses: actions/[email protected]
with:
name: PDF Glyphs
path: glyph_collections/pdf
- name: Upload zipfile of PNGs
uses: actions/[email protected]
with:
name: PNG Glyphs
path: glyph_collections/png
- if: github.event_name == 'release'
name: Compress glyphs
run: |
zip -j glyphs-svg glyph_collections/svg/*
zip -j glyphs-pdf glyph_collections/pdf/*
zip -j glyphs-png glyph_collections/png/*
- if: github.event_name == 'release'
name: Upload glyphs as release artifact
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
glyphs-svg.zip
glyphs-pdf.zip
glyphs-png.zip