Skip to content

Commit d2e1a58

Browse files
committed
Create documentation.yml
Add a new CI task for auto-generating documentation content.
1 parent bbb9fb8 commit d2e1a58

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/documentation.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
document:
10+
runs-on: windows-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: seanmiddleditch/gha-setup-vsdevenv@master
15+
16+
- name: Install Swift 5.5-DEVELOPMENT-SNAPSHOT-2021-05-02-a
17+
run: |
18+
Install-Binary -Url "https://swift.org/builds/swift-5.5-branch/windows10/swift-5.5-DEVELOPMENT-SNAPSHOT-2021-05-02-a/swift-5.5-DEVELOPMENT-SNAPSHOT-2021-05-02-a-windows10.exe" -Name "installer.exe" -ArgumentList ("-q")
19+
- name: Set Environment Variables
20+
run: |
21+
echo "SDKROOT=C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
22+
echo "DEVELOPER_DIR=C:\Library\Developer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
23+
- name: Adjust Paths
24+
run: |
25+
echo "C:\Library\Swift-development\bin;C:\Library\icu-67\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
26+
echo "C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
27+
- name: Install Supporting Files
28+
run: |
29+
Copy-Item "$env:SDKROOT\usr\share\ucrt.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\ucrt\module.modulemap"
30+
Copy-Item "$env:SDKROOT\usr\share\visualc.modulemap" -destination "$env:VCToolsInstallDir\include\module.modulemap"
31+
Copy-Item "$env:SDKROOT\usr\share\visualc.apinotes" -destination "$env:VCToolsInstallDir\include\visualc.apinotes"
32+
Copy-Item "$env:SDKROOT\usr\share\winsdk.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\um\module.modulemap"
33+
34+
# TODO(compnerd) this should get merged into swift-doc's distribution
35+
- name: Fetch graphviz
36+
run: |
37+
Invoke-WebRequest -Uri "https://artprodeus21.artifacts.visualstudio.com/A8fd008a0-56bc-482c-ba46-67f9425510be/3133d6ab-80a8-4996-ac4f-03df25cd3224/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2NvbXBuZXJkL3Byb2plY3RJZC8zMTMzZDZhYi04MGE4LTQ5OTYtYWM0Zi0wM2RmMjVjZDMyMjQvYnVpbGRJZC81MDQ4NS9hcnRpZmFjdE5hbWUvZ3JhcGh2aXotd2luZG93cy14NjQ1/content?format=zip" -OutFile $env:Temp\graphviz-windows-x64.zip
38+
Expand-Archive -Path $env:Temp\graphviz-windows-x64.zip -Destination $env:Temp -Force
39+
Move-Item -Path $env:Temp\graphviz-windows-x64\Library\graphviz-development -Destination C:\Library\ -Force
40+
- name: Add graphviz to PATH
41+
run: |
42+
echo "C:\Library\graphviz-development\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
43+
44+
- uses: robinraju/release-downloader@v1
45+
with:
46+
repository: compnerd/swift-build
47+
tag: swift-doc-5.5-DEVELOPMENT-SNAPSHOT-2021-05-02-a
48+
fileName: swift-doc.exe
49+
out-file-path: C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\
50+
51+
- name: Generate Documentation
52+
run: |
53+
New-Item -Path . -Name root -ItemType Directory
54+
git -C root init
55+
git -C root set-remote origin [email protected]:compnerd/swift-win32.git
56+
swift doc generate Sources\SwiftWin32\CoreGraphics --module-name CoreGraphics --output root\CoreGraphics --format html --base-url https://compnerd.github.io/swift-win32/CoreGraphics
57+
swift doc generate Sources\SwiftWin32 --module-name SwiftWin32 --output root\SwiftWin32 --format html --base-url https://compnerd.github.io/swift-win32/SwiftWin32
58+
swift doc generate Sources\SwiftWin32UI --module-name SwiftWin32UI --output root\SwiftWin32UI --format html --base-url https://compnerd.github.io/swift-win32/SwiftWin32UI
59+
git -C root add .
60+
git -C root commit -m "refresh content"
61+
git -C root push origin "+HEAD:gh-pages"

0 commit comments

Comments
 (0)