-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove documentation workflow * Update docc plugin dependency * Add documentation workflow * Update hosting basepath * Update JamesIves/[email protected]
- Loading branch information
Showing
3 changed files
with
88 additions
and
22 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 |
---|---|---|
@@ -1,32 +1,75 @@ | ||
# Build and deploy DocC to GitHub pages. Based off of pointfreeco/swift-composable-architecture: | ||
# https://github.com/pointfreeco/swift-composable-architecture/blob/main/.github/workflows/documentation.yml | ||
name: Documentation | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
push: | ||
branches: [ master ] | ||
paths: | ||
- .github/workflows/documentation.yml | ||
- Sources/FirebladeECS/**.swift | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
branches: [ master ] | ||
paths: | ||
- .github/workflows/documentation.yml | ||
- Sources/FirebladeECS/**.swift | ||
|
||
concurrency: | ||
group: docs-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
runs-on: macos-14 | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Generate Swift Doc Documentation | ||
uses: SwiftDocOrg/[email protected] | ||
- name: Select Xcode 16.0 | ||
run: sudo xcode-select -s /Applications/Xcode_16.0.app | ||
|
||
- name: Checkout Package | ||
uses: actions/checkout@v4 | ||
with: | ||
inputs: "Sources/FirebladeECS" | ||
output: "Documentation" | ||
- name: Publish to wiki | ||
uses: SwiftDocOrg/github-wiki-publish-action@master | ||
fetch-depth: 0 | ||
|
||
- name: Checkout gh-pages Branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: gh-pages | ||
path: docs | ||
|
||
- name: Build documentation | ||
run: > | ||
rm -rf docs/.git; | ||
rm -rf docs/master; | ||
git tag -l --sort=-v:refname | grep -e "\d\+\.\d\+.0" | tail -n +6 | xargs -I {} rm -rf {}; | ||
for tag in $(echo "master"; git tag -l --sort=-v:refname | grep -e "\d\+\.\d\+.0" | head -6); | ||
do | ||
if [ -d "docs/$tag/data/documentation/fireblade-ecs" ] | ||
then | ||
echo "✅ Documentation for "$tag" already exists."; | ||
else | ||
echo "⏳ Generating documentation for FirebladeECS @ "$tag" release."; | ||
rm -rf "docs/$tag"; | ||
git checkout .; | ||
git checkout "$tag"; | ||
DOCC_JSON_PRETTYPRINT=YES \ | ||
swift package \ | ||
--allow-writing-to-directory docs/"$tag" \ | ||
generate-documentation \ | ||
--target FirebladeECS \ | ||
--output-path docs/"$tag" \ | ||
--transform-for-static-hosting \ | ||
--hosting-base-path /FirebladeECS/"$tag" \ | ||
&& echo "✅ Documentation generated for FirebladeECS @ "$tag" release." \ | ||
|| echo "⚠️ Documentation skipped for FirebladeECS @ "$tag"."; | ||
fi; | ||
done | ||
- name: Fix permissions | ||
run: 'sudo chown -R $USER docs' | ||
|
||
- name: Publish documentation to GitHub Pages | ||
uses: JamesIves/[email protected] | ||
with: | ||
path: "Documentation" | ||
env: | ||
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
branch: gh-pages | ||
folder: docs | ||
single-commit: true |
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,23 @@ | ||
{ | ||
"pins" : [ | ||
{ | ||
"identity" : "swift-docc-plugin", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-docc-plugin", | ||
"state" : { | ||
"revision" : "85e4bb4e1cd62cec64a4b8e769dcefdf0c5b9d64", | ||
"version" : "1.4.3" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-docc-symbolkit", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/swiftlang/swift-docc-symbolkit", | ||
"state" : { | ||
"revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", | ||
"version" : "1.0.0" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
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