-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add lightweight in-tree documentation.
- Loading branch information
Showing
5 changed files
with
78 additions
and
6 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,44 @@ | ||
name: documentation | ||
on: | ||
push: | ||
branches: | ||
- unstable | ||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install bazelisk | ||
run: | | ||
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64" | ||
mkdir -p "${GITHUB_WORKSPACE}/bin/" | ||
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel" | ||
chmod +x "${GITHUB_WORKSPACE}/bin/bazel" | ||
- name: Install Swift dependencies | ||
run: | | ||
sudo apt-get install clang libicu-dev | ||
wget https://download.swift.org/swift-5.6.1-release/ubuntu2004/swift-5.6.1-RELEASE/swift-5.6.1-RELEASE-ubuntu20.04.tar.gz | ||
tar xzf swift-5.6.1-RELEASE-ubuntu20.04.tar.gz | ||
echo "$(pwd)/swift-5.6.1-RELEASE-ubuntu20.04/usr/bin" >> $GITHUB_PATH | ||
- name: Clean up documentation branch | ||
run: | | ||
git branch -D documentation || true | ||
git checkout -b documentation | ||
- name: Run docc | ||
run: | | ||
cd "${GITHUB_WORKSPACE}" && ./scripts/docc.sh | ||
- name: Add and commit documentation | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "docbot" | ||
cd "${GITHUB_WORKSPACE}" && git add "docs/*" && git commit -m "Update docs." | ||
- name: Push the new branch | ||
run: | | ||
cd "${GITHUB_WORKSPACE}" && git push --force origin documentation:documentation | ||
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
GIT_ROOT=$(git rev-parse --show-toplevel) | ||
|
||
cd $GIT_ROOT | ||
|
||
# Generate symbol graph | ||
bazel build :Dflat :SQLiteDflat --features=swift.emit_symbol_graph | ||
# Copy it into a valid bundle | ||
mkdir -p Dflat.docc | ||
cp bazel-bin/Dflat.symbolgraph/*.json Dflat.docc/ | ||
cp bazel-bin/SQLiteDflat.symbolgraph/*.json Dflat.docc/ | ||
# Remove all docs | ||
rm -rf docs | ||
# Convert into static hosting document | ||
docc convert Dflat.docc --fallback-display-name="Dflat" --fallback-bundle-identifier org.liuliu.dflat --fallback-bundle-version 0.0.1 --output-path docs --hosting-base-path /dflat --index --transform-for-static-hosting | ||
# Adding auto-redirect index.html | ||
echo '<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=https://liuliu.github.io/dflat/documentation/dflat">' > docs/index.html | ||
rm -rf Dflat.docc |