mirror of
https://github.com/gorules/zen.git
synced 2026-10-04 08:02:28 +00:00
C# CI
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user