-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for publishing documentation (#28)
fix #27 Documentation URLs: * https://datafusion-contrib.github.io/datafusion-c/ * Redirect to https://datafusion-contrib.github.io/datafusion-c/latest/ * https://datafusion-contrib.github.io/datafusion-c/${VERSION}/ * Documentation for ${VERSION} * https://datafusion-contrib.github.io/datafusion-c/latest/ * Copy of the latest https://datafusion-contrib.github.io/datafusion-c/${VERSION}/ * https://datafusion-contrib.github.io/datafusion-c/main/ * Documentation for the main branch Documentation tools: * / * Sphinx * Base contents and layout * Theme: pydata_sphinx_theme * Doxygen * DataFusion C's API reference * Comments for Doxygen are written in src/capi.rs * Integrated into Sphinx by Breathe * /glib/ * Gi-DocGen * No sphinx integration * Just hyper linked each other Deployment: * The gh-pages branch is used * The gh-pages branch is updated automatically by GitHub Actions
- Loading branch information
Showing
37 changed files
with
1,125 additions
and
89 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
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,125 @@ | ||
# Copyright 2022 Sutou Kouhei <kou@clear-code.com> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: Document | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
- name: Prepare | ||
run: | | ||
sudo apt update | ||
sudo apt install -y -V \ | ||
ca-certificates \ | ||
lsb-release \ | ||
wget | ||
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb | ||
sudo apt install -y -V \ | ||
./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb | ||
sudo apt update | ||
sudo apt install -y -V \ | ||
doxygen \ | ||
gtk-doc-tools \ | ||
libarrow-glib-dev \ | ||
libgirepository1.0-dev \ | ||
ninja-build \ | ||
valac | ||
pip install \ | ||
Jinja2 \ | ||
Pygments \ | ||
Sphinx \ | ||
breathe \ | ||
gi-docgen \ | ||
meson \ | ||
pydata_sphinx_theme | ||
case ${GITHUB_REF} in | ||
refs/tags/*) | ||
version=${GITHUB_REF#refs/tags/} | ||
;; | ||
*) | ||
version=main | ||
;; | ||
esac | ||
echo "VERSION=${version}" >> ${GITHUB_ENV} | ||
- uses: actions-rs/toolchain@v1 | ||
id: rust-toolchain | ||
with: | ||
override: true | ||
toolchain: stable | ||
- name: Cache Cargo | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cargo | ||
key: cargo-doc-${{ steps.rust-toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.toml') }} | ||
- name: Install cargo-c | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: install | ||
args: cargo-c | ||
- name: Generate | ||
run: | | ||
meson setup \ | ||
--libdir=lib \ | ||
--prefix=${HOME}/local \ | ||
-Ddoc=true \ | ||
-Dsource-reference=${VERSION} \ | ||
-Dvapi=true \ | ||
-Dwerror=true \ | ||
build \ | ||
. | ||
ninja -C build doc/html | ||
cp -a build/doc/html/ ./ | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: html | ||
path: html/ | ||
- uses: actions/checkout@v3 | ||
if: | | ||
github.event_name == 'push' && | ||
(startsWith(github.ref, 'refs/tags/') || | ||
github.ref == 'refs/heads/main') | ||
with: | ||
ref: gh-pages | ||
path: gh-pages | ||
- name: Deploy | ||
if: | | ||
github.event_name == 'push' && | ||
(startsWith(github.ref, 'refs/tags/') || | ||
github.ref == 'refs/heads/main') | ||
run: | | ||
rm -rf gh-pages/${VERSION} | ||
cp -a build/doc/html/ gh-pages/${VERSION} | ||
if [ "${VERSION}" != "main" ]; then | ||
rm -rf gh-pages/latest | ||
cp -a gh-pages/${VERSION} gh-pages/latest | ||
fi | ||
cd gh-pages | ||
if [ "$(git status --porcelain)" != "" ]; then | ||
git config user.name "github-actions[bot]" | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git add --all | ||
git commit -m "Update by ${GITHUB_SHA}" | ||
git push origin gh-pages | ||
fi | ||
doc_dir=gh-pages/${VERSION} |
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
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
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
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
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
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
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,21 @@ | ||
# Copyright 2022 Sutou Kouhei <kou@clear-code.com> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
DOXYFILE_ENCODING = UTF-8 | ||
EXTENSION_MAPPING = h=C | ||
GENERATE_HTML = NO | ||
GENERATE_LATEX = NO | ||
GENERATE_LEGEND = NO | ||
GENERATE_XML = YES | ||
PROJECT_NAME = "DataFusion C" |
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,34 @@ | ||
# Copyright 2022 Sutou Kouhei <kou@clear-code.com> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= -j auto | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
# $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
html: | ||
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help html | ||
|
Oops, something went wrong.