-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7031d5d
commit 149b0ef
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Generate docs | ||
# trying to use the same approach as: https://github.com/nvim-telescope/telescope.nvim/blob/master/.github/workflows/docgen.yml | ||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build-sources: | ||
name: Generate docs | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
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: Prepare | ||
run: | | ||
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 | ||
nvim --headless --noplugin -u scripts/minimal_init.vim -c "luafile ./scripts/gendocs.lua" -c 'qa' | ||
# inspired by nvim-lspconfigs | ||
- name: Update documentation | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COMMIT_MSG: | | ||
[docgen] Update doc/himarkdown.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}) |