-
Notifications
You must be signed in to change notification settings - Fork 20
91 lines (74 loc) · 2.32 KB
/
ci.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
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events for the main branch or for release branches
push:
branches:
- 'master'
- 'release/*'
tags:
- '*'
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Install expect
run: sudo apt-get install -y expect
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: 3.10.4
- name: Setup elan toolchain on this build
run: |
curl -O --location https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh
chmod u+x elan-init.sh
./elan-init.sh -y --default-toolchain none
- name: Set elan paths
run: |
echo "$HOME/.elan/bin" >> $GITHUB_PATH
- name: Install lean toolchain for this build
run: |
cd examples
lean --version
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: '0.4.17'
- name: Install mdbook-wordcount
uses: baptiste0928/cargo-install@v1
with:
crate: mdbook-wordcount
version: latest
- name: Build example code
run: |
cd examples
lake build
- name: Build book
run: |
cd functional-programming-lean
mdbook build
- name: Zip html contents
run: |
cd functional-programming-lean/book/
zip -rq html.zip html/
- name: Release preview zip if a new tag is pushed
uses: softprops/action-gh-release@v1
if: ${{ startsWith(github.ref, 'refs/tags/pre-') }}
with:
files: functional-programming-lean/book/html.zip
token: ${{ secrets.GITHUB_TOKEN }}
- name: Release bits if a new release tag is pushed
uses: peaceiris/actions-gh-pages@v3
if: ${{ startsWith(github.ref, 'refs/tags/release-') }}
with:
publish_dir: functional-programming-lean/book/html
publish_branch: gh-pages
external_repository: leanprover/functional_programming_in_lean
personal_token: ${{ secrets.PUBLISH_GITHUB_TOKEN }}