mirror of
https://github.com/gorules/zen.git
synced 2026-10-04 08:02:28 +00:00
revert workflow_dispatch, fork used for async generation cs bindings issue
This commit is contained in:
@@ -3,7 +3,6 @@ env:
|
||||
UNIFFI_DIRECTORY: bindings/uniffi
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
@@ -80,7 +79,7 @@ jobs:
|
||||
release-java-kotlin:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build ]
|
||||
if: "startsWith(github.event.head_commit.message, 'chore(release): publish uniffi') && github.event_name != 'workflow_dispatch'"
|
||||
if: "startsWith(github.event.head_commit.message, 'chore(release): publish uniffi')"
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ env.UNIFFI_DIRECTORY }}
|
||||
@@ -141,7 +140,7 @@ jobs:
|
||||
release-csharp:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build ]
|
||||
if: "startsWith(github.event.head_commit.message, 'chore(release): publish uniffi') || github.event_name == 'workflow_dispatch'"
|
||||
if: "startsWith(github.event.head_commit.message, 'chore(release): publish uniffi')"
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ env.UNIFFI_DIRECTORY }}
|
||||
@@ -175,9 +174,6 @@ jobs:
|
||||
--config uniffi.toml \
|
||||
--out-dir build/generated/csharp
|
||||
|
||||
# - name: Fix async callback interfaces
|
||||
# run: bash scripts/fix-csharp-bindings.sh build/generated/csharp/zen_uniffi.cs
|
||||
|
||||
- name: Upload generated C# source
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -202,16 +198,15 @@ jobs:
|
||||
path: ${{ env.UNIFFI_DIRECTORY }}/nuget/bin/Release/*.nupkg
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Push to NuGet.org
|
||||
if: "github.event_name != 'workflow_dispatch'"
|
||||
run: |
|
||||
dotnet nuget push nuget/bin/Release/*.nupkg \
|
||||
--api-key ${{ secrets.NUGET_API_KEY }} \
|
||||
--source https://api.nuget.org/v3/index.json \
|
||||
--skip-duplicate
|
||||
# - name: Push to NuGet.org
|
||||
# run: |
|
||||
# dotnet nuget push nuget/bin/Release/*.nupkg \
|
||||
# --api-key ${{ secrets.NUGET_API_KEY }} \
|
||||
# --source https://api.nuget.org/v3/index.json \
|
||||
# --skip-duplicate
|
||||
|
||||
build-ios:
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci') && github.event_name != 'workflow_dispatch'"
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
env:
|
||||
OUTPUT_NAME: zen_uniffi
|
||||
IPHONEOS_DEPLOYMENT_TARGET: '16.0'
|
||||
@@ -425,7 +420,7 @@ jobs:
|
||||
--base "master"
|
||||
|
||||
build-android:
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci') && github.event_name != 'workflow_dispatch'"
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
OUTPUT_NAME: zen_uniffi
|
||||
@@ -472,7 +467,7 @@ jobs:
|
||||
prepare-android-bindings:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build ]
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci') && github.event_name != 'workflow_dispatch'"
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
|
||||
defaults:
|
||||
run:
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# fix-csharp-bindings.sh
|
||||
#
|
||||
# Fixes the async callback interface bug in C# bindings generated by uniffi-bindgen-cs.
|
||||
#
|
||||
# The generator produces sync interface methods (returning T directly) but the
|
||||
# calling code uses await + .WaitAsync(), causing compilation errors. This script
|
||||
# patches the interface method signatures to return Task<T> instead.
|
||||
#
|
||||
# Usage: ./fix-csharp-bindings.sh <path-to-zen_uniffi.cs>
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 <path-to-zen_uniffi.cs>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FILE="$1"
|
||||
|
||||
if [ ! -f "$FILE" ]; then
|
||||
echo "Error: File not found: $FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Fixing async callback interfaces in $FILE..."
|
||||
|
||||
# Fix ZenCustomNodeCallback.Handle: sync → async (Task<>)
|
||||
sed -i.bak 's/ZenEngineHandlerResponse Handle(ZenEngineHandlerRequest @key)/Task<ZenEngineHandlerResponse> Handle(ZenEngineHandlerRequest @key)/' "$FILE"
|
||||
|
||||
# Fix ZenDecisionLoaderCallback.Load: sync → async (Task<>)
|
||||
sed -i.bak 's/JsonBuffer? Load(string @key)/Task<JsonBuffer?> Load(string @key)/' "$FILE"
|
||||
|
||||
# Clean up backup file
|
||||
rm -f "${FILE}.bak"
|
||||
|
||||
echo "Done. Fixed async interfaces in $FILE"
|
||||
Reference in New Issue
Block a user