Skip to content

Commit

Permalink
Build docs using Apple's DocC (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshihorie authored Jan 13, 2024
1 parent 8e1043d commit 16644e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 29 deletions.
41 changes: 12 additions & 29 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,28 @@
name: Publish Docs

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
workflow_dispatch:
push:
branches: [ "main" ]
tags:
- "*"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
publish:
# The type of runner that the job will run on
runs-on: ubuntu-latest
runs-on: macos-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Generate Documentation
uses: SwiftDocOrg/swift-doc@master
with:
inputs: "Sources"
module-name: LiveKit Swift Client SDK
output: "Documentation"
format: html
base-url: /client-sdk-swift

- name: Get Actions user id
id: get_uid
- name: Build DocC
run: |
actions_user_id=`id -u $USER`
echo $actions_user_id
echo ::set-output name=uid::$actions_user_id
- name: Correct Ownership in GITHUB_WORKSPACE directory
uses: peter-murray/reset-workspace-ownership-action@v1
with:
user_id: ${{ steps.get_uid.outputs.uid }}
swift package --allow-writing-to-directory ./docs generate-documentation \
--target LiveKit \
--output-path ./docs \
--transform-for-static-hosting \
--hosting-base-path /client-sdk-swift
- name: S3 Upload
run: aws s3 sync Documentation/ s3://livekit-docs/client-sdk-swift/
run: aws s3 sync docs/ s3://livekit-docs/client-sdk-swift/
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOY_AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_AWS_API_SECRET }}
Expand Down
1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ let package = Package(
.package(name: "WebRTC", url: "https://github.com/livekit/webrtc-xcframework.git", .exact("114.5735.10")),
.package(name: "SwiftProtobuf", url: "https://github.com/apple/swift-protobuf.git", .upToNextMajor(from: "1.25.2")),
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.5.3")),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0"),
],
targets: [
.systemLibrary(name: "CHeaders"),
Expand Down

0 comments on commit 16644e3

Please sign in to comment.