This commit is contained in:
bojancrevar
2026-02-23 09:41:36 +01:00
parent 6beecb423f
commit 9fcde9d5ce
5 changed files with 177 additions and 0 deletions
+56
View File
@@ -137,6 +137,62 @@ jobs:
run: ./gradlew publishMavenKotlinPublicationToCentralPortal publishMavenJavaPublicationToCentralPortal
release-csharp:
runs-on: ubuntu-latest
needs: [ build ]
if: "startsWith(github.event.head_commit.message, 'chore(release): publish uniffi')"
defaults:
run:
working-directory: ${{ env.UNIFFI_DIRECTORY }}
steps:
- uses: actions/checkout@v3
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: build/generated/resources
- name: Move artifacts
run: mv ../../build ./
- name: Install uniffi-bindgen-cs
run: cargo install uniffi-bindgen-cs --git https://github.com/aspect-build/uniffi-bindgen-cs --tag v0.10.0+v0.29.4
- name: Generate C# bindings
run: |
uniffi-bindgen-cs \
--library build/generated/resources/darwin-x86-64/libzen_uniffi.dylib \
--out-dir build/generated/csharp
- name: Fix async callback interfaces
run: bash scripts/fix-csharp-bindings.sh build/generated/csharp/zen_uniffi.cs
- name: Extract version from Cargo.toml
id: version
run: |
VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Detected version: $VERSION"
- name: Pack NuGet package
run: dotnet pack nuget/GoRules.ZenEngine.csproj -c Release -p:Version=$VERSION
- 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')"
env: