-
Notifications
You must be signed in to change notification settings - Fork 85
108 lines (90 loc) · 2.81 KB
/
build-spec.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
name: Build Spec
on:
push:
branches-ignore:
- 'temp/*'
tags:
- '*'
pull_request:
branches:
- 'main'
- 'v3.0.x'
- 'v2.0.x'
jobs:
build-code-snippets:
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected]
- name: Build code snippets
run: |
mkdir docs/examples/build
cd docs/examples/build
cmake ..
cmake --build .
generate-schema-figures:
runs-on: windows-2022
steps:
- uses: actions/[email protected]
- run: |
PowerShell -ExecutionPolicy Bypass -Command ./generate_figures.ps1
- name: Create ZIP archive
uses: actions/[email protected]
with:
name: schema-figures
path: docs/images/schema/*.png
if-no-files-found: error
generate-html:
runs-on: ubuntu-20.04
needs: [generate-schema-figures]
steps:
- name: Checkout
uses: actions/[email protected]
with:
submodules: recursive
- uses: actions/[email protected]
with:
name: schema-figures
path: docs/images/schema
- name: Generate revnumber
run: |
[[ $GITHUB_REF_TYPE == "tag" ]] && REVNUMBER=${GITHUB_REF:11} || REVNUMBER=${GITHUB_SHA:0:7}
echo GITHUB_SHA: $GITHUB_SHA
echo GITHUB_REF_TYPE: $GITHUB_REF_TYPE
echo GITHUB_REF: $GITHUB_REF
echo REVNUMBER: $REVNUMBER
echo "REVNUMBER=$REVNUMBER" >> $GITHUB_ENV
- name: Create build directory
run: |
mkdir -p build/headers
mkdir -p build/schema
mkdir -p build/images/schema
- name: Generate HTML
uses: avattathil/asciidoctor-action@master
with:
program: "asciidoctor --base-dir . --destination-dir=build --backend=html5 --attribute=revnumber=${{ env.REVNUMBER }} --attribute=revdate=$(date +%F) docs/index.adoc"
- name: Copy resources
run: |
cp LICENSE.txt build
cp headers/*.h build/headers
cp schema/*.xsd build/schema
cp docs/images/favicon.ico build/images
cp docs/images/*.svg build/images
cp docs/images/schema/*.png build/images/schema
- name: Create ZIP archive
uses: actions/[email protected]
with:
name: FMI-Specification
path: build/*
if-no-files-found: error
- name: Push HTML to fmi-standard.org
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: cpina/[email protected]
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
with:
source-directory: 'build'
destination-github-username: 'modelica'
destination-repository-name: 'fmi-standard.org'
user-email: ci@fmi-standard
target-branch: main
target-directory: static/docs/main