Skip to content

Commit 98538ef

Browse files
authored
Merge pull request #677 from Cysharp/feature/docs
ci: replace docfx build from container to docfx command
2 parents 95998ff + 519590c commit 98538ef

File tree

3 files changed

+51
-11
lines changed

3 files changed

+51
-11
lines changed

.config/dotnet-tools.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"docfx": {
6+
"version": "2.78.3",
7+
"commands": [
8+
"docfx"
9+
],
10+
"rollForward": false
11+
}
12+
}
13+
}

.github/workflows/build-docs.yaml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,49 @@ on:
88

99
jobs:
1010
run-docfx:
11+
if: ${{ ((github.event_name == 'push' && github.repository_owner == 'Cysharp') || startsWith(github.event.pull_request.head.label, 'Cysharp:')) && github.triggering_actor != 'dependabot[bot]' }}
1112
permissions:
1213
contents: write
1314
pages: write
1415
runs-on: ubuntu-24.04
1516
timeout-minutes: 10
1617
steps:
18+
- name: Load secrets
19+
id: op-load-secret
20+
uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0 # v2.0.0
21+
with:
22+
export-env: false
23+
env:
24+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_PUBLIC }}
25+
UNITY_EMAIL: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/username"
26+
UNITY_PASSWORD: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/credential"
27+
UNITY_SERIAL: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/serial"
1728
- uses: Cysharp/Actions/.github/actions/checkout@main
29+
# Execute scripts: Export Package
30+
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
31+
- name: Build Unity (.unitypackage)
32+
uses: Cysharp/Actions/.github/actions/unity-builder@main
33+
env:
34+
UNITY_EMAIL: ${{ steps.op-load-secret.outputs.UNITY_EMAIL }}
35+
UNITY_PASSWORD: ${{ steps.op-load-secret.outputs.UNITY_PASSWORD }}
36+
UNITY_SERIAL: ${{ steps.op-load-secret.outputs.UNITY_SERIAL }}
37+
with:
38+
projectPath: src/UniTask
39+
unityVersion: "2022.3.39f1"
40+
targetPlatform: StandaloneLinux64
41+
buildMethod: PackageExporter.Export
42+
1843
- uses: Cysharp/Actions/.github/actions/checkout@main
1944
with:
2045
repository: Cysharp/DocfxTemplate
2146
path: docs/_DocfxTemplate
22-
- uses: Kirbyrawr/docfx-action@db9a22c8fe1e8693a2a21be54cb0b87dfaa72cc4
23-
name: Docfx metadata
24-
with:
25-
args: metadata docs/docfx.json
26-
- uses: Kirbyrawr/docfx-action@db9a22c8fe1e8693a2a21be54cb0b87dfaa72cc4
27-
name: Docfx build
28-
with:
29-
args: build docs/docfx.json
47+
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
48+
- name: dotnet tool restore
49+
run: dotnet tool restore
50+
- name: Docfx metadata
51+
run: dotnet docfx metadata docs/docfx.json
52+
- name: Docfx build
53+
run: dotnet docfx build docs/docfx.json
3054
- name: Publish to GitHub Pages
3155
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
3256
with:

docs/docfx.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
"src": [
55
{
66
"files": [
7-
"UniTask/Assets/Plugins/UniTask/Runtime/**/*.cs"
7+
"UniTask/Library/ScriptAssemblies/UniTask*.dll"
8+
],
9+
"exclude": [
10+
"UniTask/Library/ScriptAssemblies/UniTask.Tests.dll",
11+
"UniTask/Library/ScriptAssemblies/UniTask.Tests.Editor.dll"
812
],
913
"src": "../src"
1014
}
@@ -54,7 +58,6 @@
5458
}
5559
],
5660
"dest": "_site",
57-
5861
"globalMetadataFiles": [],
5962
"fileMetadataFiles": [],
6063
"template": [
@@ -67,4 +70,4 @@
6770
"keepFileLink": false,
6871
"cleanupCacheHistory": false
6972
}
70-
}
73+
}

0 commit comments

Comments
 (0)