Compare commits
3 Commits
a942b15483
...
37aa0ef713
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37aa0ef713 | ||
|
|
295b701be1 | ||
|
|
984b0dd29c |
57
.github/workflows/docs.yml
vendored
57
.github/workflows/docs.yml
vendored
@@ -26,50 +26,25 @@ jobs:
|
||||
- name: Set up Swift
|
||||
uses: swift-actions/setup-swift@v3
|
||||
with:
|
||||
swift-version: '6.2.4'
|
||||
- name: Inject DocC Plugin Dependency
|
||||
run: |
|
||||
if ! grep -q 'swift-docc-plugin' Package.swift; then
|
||||
awk 'BEGIN{done=0} /dependencies: \[/ && done==0 {print; print "\t\t.package(url: \"https://github.com/apple/swift-docc-plugin.git\", from: \"1.4.0\"),"; done=1; next}1' Package.swift > Package.swift.tmp
|
||||
mv Package.swift.tmp Package.swift
|
||||
fi
|
||||
skip-verify-signature: true
|
||||
- name: Generate Docs
|
||||
run: |
|
||||
swift package generate-documentation --target Inotify
|
||||
swift package generate-documentation --target TaskCLI
|
||||
- name: Transform for Static Hosting
|
||||
swift package add-dependency --from 1.4.0 "https://github.com/apple/swift-docc-plugin.git"
|
||||
for target in Inotify TaskCLI; do
|
||||
lower="${target,,}"
|
||||
mkdir -p "./public/$lower"
|
||||
swift package --allow-writing-to-directory "./public/$lower" \
|
||||
generate-documentation --disable-indexing --transform-for-static-hosting \
|
||||
--target "$target" \
|
||||
--hosting-base-path "swift-inotify/$lower" \
|
||||
--output-path "./public/$lower"
|
||||
done
|
||||
- name: Copy Index Page
|
||||
run: |
|
||||
OUTPUTS=.build/plugins/Swift-DocC/outputs
|
||||
|
||||
mkdir -p ./public/inotify ./public/taskcli
|
||||
|
||||
docc process-archive transform-for-static-hosting \
|
||||
"$OUTPUTS/Inotify.doccarchive" \
|
||||
--output-path ./public/inotify \
|
||||
--hosting-base-path swift-inotify/inotify
|
||||
|
||||
docc process-archive transform-for-static-hosting \
|
||||
"$OUTPUTS/TaskCLI.doccarchive" \
|
||||
--output-path ./public/taskcli \
|
||||
--hosting-base-path swift-inotify/taskcli
|
||||
- name: Create Index Page
|
||||
run: |
|
||||
cat > ./public/index.html <<'HTML'
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Swift Inotify – Documentation</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Swift Inotify – Documentation</h1>
|
||||
<ul>
|
||||
<li><a href="inotify/documentation/inotify/">Inotify: The actual library.</a></li>
|
||||
<li><a href="taskcli/documentation/taskcli/">TaskCLI: The project build command.</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
HTML
|
||||
cp ./.github/workflows/index.tpl.html public/index.html
|
||||
sed -i -e 's/{{project.name}}/Swift Inotify/g' public/index.html
|
||||
sed -i -e 's/{{project.tagline}}/🗂️ Monitor filesystem events on Linux using modern Swift concurrency/g' public/index.html
|
||||
sed -i -e 's|{{project.links}}|<li><a href="inotify/documentation/inotify/">Inotify</a>: The actual library.</li><li><a href="taskcli/documentation/taskcli/">TaskCLI</a>: The project build command.</li>|g' public/index.html
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v4
|
||||
with:
|
||||
|
||||
66
.github/workflows/index.tpl.html
vendored
Normal file
66
.github/workflows/index.tpl.html
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user