Compare commits

...

6 Commits

Author SHA1 Message Date
Tommaso Checchi
b999b17b90 Merge 6b1e951b64 into 98538ef7c7 2025-09-13 01:24:24 +09:00
Ikiru Yoshizaki
98538ef7c7 Merge pull request #677 from Cysharp/feature/docs
ci: replace docfx build from container to docfx command
2025-09-13 01:23:03 +09:00
Ikiru Yoshizaki
519590ca6e chore: exclude tests assemblies 2025-09-10 18:38:31 +09:00
Ikiru Yoshizaki
dce4366f3e ci: change docfx target from source code to Unity built assemblies 2025-09-10 18:20:17 +09:00
Ikiru Yoshizaki
88026ab14a ci: replace docfx build from container to docfx command 2025-09-10 17:20:43 +09:00
Tommaso Checchi
6b1e951b64 RunOnThreadPool: fixed an issue where a cancellation could prevent returning to the main thread 2025-07-09 21:29:12 -07:00
4 changed files with 67 additions and 29 deletions

13
.config/dotnet-tools.json Normal file
View File

@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"docfx": {
"version": "2.78.3",
"commands": [
"docfx"
],
"rollForward": false
}
}
}

View File

@@ -8,25 +8,49 @@ on:
jobs: jobs:
run-docfx: run-docfx:
if: ${{ ((github.event_name == 'push' && github.repository_owner == 'Cysharp') || startsWith(github.event.pull_request.head.label, 'Cysharp:')) && github.triggering_actor != 'dependabot[bot]' }}
permissions: permissions:
contents: write contents: write
pages: write pages: write
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- name: Load secrets
id: op-load-secret
uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0 # v2.0.0
with:
export-env: false
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_PUBLIC }}
UNITY_EMAIL: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/username"
UNITY_PASSWORD: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/credential"
UNITY_SERIAL: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/serial"
- uses: Cysharp/Actions/.github/actions/checkout@main - uses: Cysharp/Actions/.github/actions/checkout@main
# Execute scripts: Export Package
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
- name: Build Unity (.unitypackage)
uses: Cysharp/Actions/.github/actions/unity-builder@main
env:
UNITY_EMAIL: ${{ steps.op-load-secret.outputs.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ steps.op-load-secret.outputs.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ steps.op-load-secret.outputs.UNITY_SERIAL }}
with:
projectPath: src/UniTask
unityVersion: "2022.3.39f1"
targetPlatform: StandaloneLinux64
buildMethod: PackageExporter.Export
- uses: Cysharp/Actions/.github/actions/checkout@main - uses: Cysharp/Actions/.github/actions/checkout@main
with: with:
repository: Cysharp/DocfxTemplate repository: Cysharp/DocfxTemplate
path: docs/_DocfxTemplate path: docs/_DocfxTemplate
- uses: Kirbyrawr/docfx-action@db9a22c8fe1e8693a2a21be54cb0b87dfaa72cc4 - uses: Cysharp/Actions/.github/actions/setup-dotnet@main
name: Docfx metadata - name: dotnet tool restore
with: run: dotnet tool restore
args: metadata docs/docfx.json - name: Docfx metadata
- uses: Kirbyrawr/docfx-action@db9a22c8fe1e8693a2a21be54cb0b87dfaa72cc4 run: dotnet docfx metadata docs/docfx.json
name: Docfx build - name: Docfx build
with: run: dotnet docfx build docs/docfx.json
args: build docs/docfx.json
- name: Publish to GitHub Pages - name: Publish to GitHub Pages
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with: with:

View File

@@ -4,7 +4,11 @@
"src": [ "src": [
{ {
"files": [ "files": [
"UniTask/Assets/Plugins/UniTask/Runtime/**/*.cs" "UniTask/Library/ScriptAssemblies/UniTask*.dll"
],
"exclude": [
"UniTask/Library/ScriptAssemblies/UniTask.Tests.dll",
"UniTask/Library/ScriptAssemblies/UniTask.Tests.Editor.dll"
], ],
"src": "../src" "src": "../src"
} }
@@ -54,7 +58,6 @@
} }
], ],
"dest": "_site", "dest": "_site",
"globalMetadataFiles": [], "globalMetadataFiles": [],
"fileMetadataFiles": [], "fileMetadataFiles": [],
"template": [ "template": [
@@ -67,4 +70,4 @@
"keepFileLink": false, "keepFileLink": false,
"cleanupCacheHistory": false "cleanupCacheHistory": false
} }
} }

View File

@@ -66,12 +66,11 @@ namespace Cysharp.Threading.Tasks
await UniTask.SwitchToThreadPool(); await UniTask.SwitchToThreadPool();
cancellationToken.ThrowIfCancellationRequested();
if (configureAwait) if (configureAwait)
{ {
try try
{ {
cancellationToken.ThrowIfCancellationRequested();
action(); action();
} }
finally finally
@@ -81,6 +80,7 @@ namespace Cysharp.Threading.Tasks
} }
else else
{ {
cancellationToken.ThrowIfCancellationRequested();
action(); action();
} }
@@ -94,12 +94,11 @@ namespace Cysharp.Threading.Tasks
await UniTask.SwitchToThreadPool(); await UniTask.SwitchToThreadPool();
cancellationToken.ThrowIfCancellationRequested();
if (configureAwait) if (configureAwait)
{ {
try try
{ {
cancellationToken.ThrowIfCancellationRequested();
action(state); action(state);
} }
finally finally
@@ -109,6 +108,7 @@ namespace Cysharp.Threading.Tasks
} }
else else
{ {
cancellationToken.ThrowIfCancellationRequested();
action(state); action(state);
} }
@@ -122,12 +122,11 @@ namespace Cysharp.Threading.Tasks
await UniTask.SwitchToThreadPool(); await UniTask.SwitchToThreadPool();
cancellationToken.ThrowIfCancellationRequested();
if (configureAwait) if (configureAwait)
{ {
try try
{ {
cancellationToken.ThrowIfCancellationRequested();
await action(); await action();
} }
finally finally
@@ -137,6 +136,7 @@ namespace Cysharp.Threading.Tasks
} }
else else
{ {
cancellationToken.ThrowIfCancellationRequested();
await action(); await action();
} }
@@ -150,12 +150,11 @@ namespace Cysharp.Threading.Tasks
await UniTask.SwitchToThreadPool(); await UniTask.SwitchToThreadPool();
cancellationToken.ThrowIfCancellationRequested();
if (configureAwait) if (configureAwait)
{ {
try try
{ {
cancellationToken.ThrowIfCancellationRequested();
await action(state); await action(state);
} }
finally finally
@@ -165,6 +164,7 @@ namespace Cysharp.Threading.Tasks
} }
else else
{ {
cancellationToken.ThrowIfCancellationRequested();
await action(state); await action(state);
} }
@@ -178,12 +178,11 @@ namespace Cysharp.Threading.Tasks
await UniTask.SwitchToThreadPool(); await UniTask.SwitchToThreadPool();
cancellationToken.ThrowIfCancellationRequested();
if (configureAwait) if (configureAwait)
{ {
try try
{ {
cancellationToken.ThrowIfCancellationRequested();
return func(); return func();
} }
finally finally
@@ -194,6 +193,7 @@ namespace Cysharp.Threading.Tasks
} }
else else
{ {
cancellationToken.ThrowIfCancellationRequested();
return func(); return func();
} }
} }
@@ -205,23 +205,22 @@ namespace Cysharp.Threading.Tasks
await UniTask.SwitchToThreadPool(); await UniTask.SwitchToThreadPool();
cancellationToken.ThrowIfCancellationRequested();
if (configureAwait) if (configureAwait)
{ {
try try
{ {
cancellationToken.ThrowIfCancellationRequested();
return await func(); return await func();
} }
finally finally
{ {
cancellationToken.ThrowIfCancellationRequested();
await UniTask.Yield(); await UniTask.Yield();
cancellationToken.ThrowIfCancellationRequested(); cancellationToken.ThrowIfCancellationRequested();
} }
} }
else else
{ {
cancellationToken.ThrowIfCancellationRequested();
var result = await func(); var result = await func();
cancellationToken.ThrowIfCancellationRequested(); cancellationToken.ThrowIfCancellationRequested();
return result; return result;
@@ -235,12 +234,11 @@ namespace Cysharp.Threading.Tasks
await UniTask.SwitchToThreadPool(); await UniTask.SwitchToThreadPool();
cancellationToken.ThrowIfCancellationRequested();
if (configureAwait) if (configureAwait)
{ {
try try
{ {
cancellationToken.ThrowIfCancellationRequested();
return func(state); return func(state);
} }
finally finally
@@ -251,6 +249,7 @@ namespace Cysharp.Threading.Tasks
} }
else else
{ {
cancellationToken.ThrowIfCancellationRequested();
return func(state); return func(state);
} }
} }
@@ -262,23 +261,22 @@ namespace Cysharp.Threading.Tasks
await UniTask.SwitchToThreadPool(); await UniTask.SwitchToThreadPool();
cancellationToken.ThrowIfCancellationRequested();
if (configureAwait) if (configureAwait)
{ {
try try
{ {
cancellationToken.ThrowIfCancellationRequested();
return await func(state); return await func(state);
} }
finally finally
{ {
cancellationToken.ThrowIfCancellationRequested();
await UniTask.Yield(); await UniTask.Yield();
cancellationToken.ThrowIfCancellationRequested(); cancellationToken.ThrowIfCancellationRequested();
} }
} }
else else
{ {
cancellationToken.ThrowIfCancellationRequested();
var result = await func(state); var result = await func(state);
cancellationToken.ThrowIfCancellationRequested(); cancellationToken.ThrowIfCancellationRequested();
return result; return result;