-
Notifications
You must be signed in to change notification settings - Fork 222
109 lines (97 loc) · 3.45 KB
/
Copy pathpublish-docs.yaml
File metadata and controls
109 lines (97 loc) · 3.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Publish Docs
on:
workflow_dispatch:
inputs:
dry_run:
description: Dry run (only list files, don't upload)
default: true
type: boolean
ref:
description: Git ref to get docs from (branch, tag, or SHA)
default: main
type: string
release:
types: [published]
permissions:
contents: read
jobs:
symbol-graph:
name: Symbol Graph (${{ matrix.artifact_name }})
runs-on: macos-26
strategy:
matrix:
include:
- platform: "iOS Simulator,name=iPhone 17 Pro,OS=26.1"
artifact_name: symbol-graph-ios
- platform: "macOS"
artifact_name: symbol-graph-macos
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'release' && github.event.release.tag_name || github.event.inputs.ref || 'main' }}
fetch-depth: 0
fetch-tags: true
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "26.1"
- name: Build for Release - Symbol Graph
run: |
set -o pipefail && xcodebuild build \
-scheme LiveKit \
-configuration Release \
-destination 'platform=${{ matrix.platform }}' \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
OTHER_SWIFT_FLAGS="-Xfrontend -emit-symbol-graph -Xfrontend -emit-symbol-graph-dir -Xfrontend \"${PWD}/symbol-graph\"" \
DOCC_EXTRACT_EXTENSION_SYMBOLS=YES \
| xcbeautify --renderer github-actions
- name: Upload Symbol Graph
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: symbol-graph
publish:
name: Publish Docs
needs: symbol-graph
runs-on: macos-26
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'release' && github.event.release.tag_name || github.event.inputs.ref || 'main' }}
fetch-depth: 0
fetch-tags: true
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "26.1"
- name: Download Symbol Graphs
uses: actions/download-artifact@v4
with:
pattern: symbol-graph-*
path: symbol-graphs
- name: Build Docs
run: |
$(xcrun --find docc) convert \
Sources/LiveKit/LiveKit.docc \
--output-dir docs \
--additional-symbol-graph-dir symbol-graphs \
--transform-for-static-hosting \
--hosting-base-path /reference/client-sdk-swift/
- name: List Files
run: ls -la docs
- name: S3 Upload
if: github.event_name == 'release' || github.event.inputs.dry_run != 'true'
run: aws s3 cp docs/ s3://livekit-docs/client-sdk-swift --recursive
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOY_AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_AWS_API_SECRET }}
AWS_DEFAULT_REGION: "us-east-1"
- name: Invalidate cache
if: github.event_name == 'release' || github.event.inputs.dry_run != 'true'
run: aws cloudfront create-invalidation --distribution-id EJJ40KLJ3TRY9 --paths "/*"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOY_AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_AWS_API_SECRET }}
AWS_DEFAULT_REGION: "us-east-1"