-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (70 loc) · 2.58 KB
/
ubuntu.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
name: Ubuntu
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Python cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-refreshed-at-20201030
restore-keys: |
${{ runner.os }}-pip-
- name: Download python dependencies
run: |
python -m pip install setuptools wheel
python -m pip install conan ninja
- name: Conan cache
uses: actions/cache@v2
with:
path: ~/.conan
key: ${{ runner.os }}-conan-refreshed-at-20201030
restore-keys: |
${{ runner.os }}-conan-
- name: Configure
run: |
cmake -S. -Bbuild -G Ninja -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_C_COMPILER="clang" -DCMAKE_BUILD_TYPE="Release" -DENABLE_TESTING=ON -DENABLE_PACKAGING=ON -DCPACK_PACKAGE_FILE_NAME=tolc
- name: Build
run: cmake --build build -j4
- name: Run tests
run: |
cd build
ctest --output-on-failure -j4
- name: Build the release tar.xz package
if: github.ref == 'refs/heads/main'
run: cpack -G TXZ --config build/CPackConfig.cmake
- name: Push release
if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
# Move to keep the directory on Github Actions free from filename clashes
mv tolc.tar.xz tolc-Linux.tar.xz
echo "Pushing to the latest tag"
gh release create latest --title "Latest release from main" --notes "This release gets updated on each commit to main" || true
gh release upload latest tolc-Linux.tar.xz --clobber
version="$(cat docs/ReleaseNotes/version)"
echo "Making sure the release ${version} is online"
test -f docs/ReleaseNotes/${version}.md
gh release create "${version}" --title "${version}" --notes-file "docs/ReleaseNotes/${version}.md" || true
gh release upload "${version}" tolc-Linux.tar.xz || true
- name: Deploy documentation to github-pages
if: github.ref == 'refs/heads/main'
run: |
python -m pip install mkdocs-material
cd docs/packaging
mkdocs gh-deploy --strict --force --config-file ./mkdocs.yml