-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (63 loc) · 2.36 KB
/
docs.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
name: Generate docs
on:
push:
branches-ignore:
- master
pull_request_target:
branches:
- master
jobs:
build-sources:
name: Generate docs
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
url: https://github.com/neovim/neovim/releases/download/v0.9.5/nvim-linux64.tar.gz
steps:
- uses: actions/checkout@v4
- run: date +%F > todays-date
- name: Restore cache for today's nightly.
uses: actions/cache@v4
with:
path: _neovim
key: ${{ runner.os }}-${{ matrix.url }}-${{ hashFiles('todays-date') }}
- name: Prepare
run: |
test -d _neovim || {
mkdir -p _neovim
curl -sL ${{ matrix.url }} | tar xzf - --strip-components=1 -C "${PWD}/_neovim"
}
mkdir -p ~/.local/share/nvim/site/pack/vendor/start
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
git clone https://github.com/tjdevries/tree-sitter-lua ~/.local/share/nvim/site/pack/vendor/start/tree-sitter-lua
ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start
- name: Build parser
run: |
# We have to build the parser every single time to keep up with parser changes
cd ~/.local/share/nvim/site/pack/vendor/start/tree-sitter-lua
git checkout 86f74dfb69c570f0749b241f8f5489f8f50adbea
make dist
cd -
- name: Generating docs
run: |
export PATH="${PWD}/_neovim/bin:${PATH}"
export VIM="${PWD}/_neovim/share/nvim/runtime"
nvim --version
make docgen
# inspired by nvim-lspconfigs
- name: Update documentation
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_MSG: |
[docgen] Update doc/pymple.txt
skip-checks: true
run: |
git config user.email "actions@github"
git config user.name "Github Actions"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git add doc/
# Only commit and push if we have changes
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:${GITHUB_REF})