-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (79 loc) · 3.34 KB
/
Copy pathmain.yml
File metadata and controls
82 lines (79 loc) · 3.34 KB
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
name: Automated Build
on:
push:
branches:
- master
paths:
- data/**
- configs/**
- layouts/**
- .github/workflows/**
workflow_dispatch:
env:
THERION_VERSION: 5.5.6
THERION_PATH: ./therion-5.5.6
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache Therion
id: cache-therion
uses: actions/cache@v1
with:
path: ${{ env.THERION_PATH }}/bin
key: ${{ runner.os }}-${{ env.THERION_VERSION }}
#========================= INSTALL DEPENDENCIES ========================#
- name: Run apt update
run: sudo apt update
- name: Install Therion compilation dependencies
if: steps.cache-therion.outputs.cache-hit != 'true'
run: sudo apt install -y bwidget lcdf-typetools libtk-img-dev libtk-img libvtk6-dev libvtk6.3 libwxgtk3.0-dev tcl-dev survex texlive-latex-base # Pre-installed: gcc ghostscript imagemagick libfreetype6-dev libjpeg-dev libpng-dev zlib1g zlib1g-dev
- name: Install Therion runtime dependencies
run: sudo apt install -y libproj-dev texlive-metapost survex
- name: Download and unpack Therion
if: steps.cache-therion.outputs.cache-hit != 'true'
run: |
curl https://github.com/therion/therion/archive/v${THERION_VERSION}.tar.gz -L -O
tar xvzf v${THERION_VERSION}.tar.gz
- name: Build Therion
if: steps.cache-therion.outputs.cache-hit != 'true'
run: |
make -C $THERION_PATH
mkdir ${THERION_PATH}/bin
mv ${THERION_PATH}/therion ${THERION_PATH}/bin/therion
- name: Install svgo
run: sudo npm install -g svgo
#=========================== GENERATE OUTPUT ===========================#
- name: Generate output files
run: find configs/automation -type f -name "*.thconfig" -exec echo -e "\n\nGenerating {}" \; -exec ${THERION_PATH}/bin/therion -q {} \;
#=========================== COMPRESS OUTPUT ===========================#
- name: Compress PDFs
run: |
for file in ./outputs/*.pdf; do
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=temp.pdf $file;
mv temp.pdf $file;
done
- name: Compress SVGs
run: svgo -f ./outputs/
#=========================== CREATE LISTING ===========================#
- name: Generate listing
run: python3 ./scripts/create_file_listing.py ./outputs/ ./outputs/listing.json
#=========================== GENERATE STATS ===========================#
- name: Generate stats
run: python3 ./scripts/create_system_stats.py data/system_migovec.th --json ./outputs/stats.json --therion-path ${THERION_PATH}/bin/therion
#=============================== UPLOADS ===============================#
- name: Upload Files
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
title: Build ${{ github.run_number }}
automatic_release_tag: "latest"
prerelease: false
files: |
./outputs/listing.json
./outputs/stats.json
./outputs/*.3d
./outputs/*.lox
./outputs/*.pdf
./outputs/*.svg