Skip to content

Commit

Permalink
fix: dotnet lib build folder
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Jul 9, 2024
1 parent e414c17 commit a2e27f0
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 60 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/cla.yml

This file was deleted.

18 changes: 10 additions & 8 deletions .github/workflows/dotnet-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,14 @@ jobs:
cargo build --release --target ${{ matrix.target }}
- name: 'Upload artifact'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: kcl-lib-${{ matrix.classifier }}
path: |
target/release/${{ matrix.target }}/${{ matrix.lib-name }}
if-no-files-found: error
path: ${{ github.workspace }}/dotnet/target/${{ matrix.target }}/release/${{ matrix.lib-name }}

deploy:
name: Deploy KCL .NET Library to Nuget
runs-on: ubuntu-latest

permissions:
Expand All @@ -127,31 +128,31 @@ jobs:
components: clippy, rustfmt

- name: Download windows x86_64 lib
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: kcl-lib-win-x64
path: KclLib/runtimes/win-x64/native

- name: Download linux aarch_64 lib
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: kcl-lib-linux-arm64
path: KclLib/runtimes/linux-arm64/native

- name: Download linux x86_64 lib
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: kcl-lib-linux-x64
path: KclLib/runtimes/linux-x64/native

- name: Download darwin x86_64 lib
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: kcl-lib-osx-x64
path: KclLib/runtimes/osx-x64/native

- name: Download darwin aarch_64 lib
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: kcl-lib-osx-arm64
path: KclLib/runtimes/osx-arm64/native
Expand All @@ -160,6 +161,7 @@ jobs:
# if: "startsWith(github.ref, 'refs/tags/')"
run: |
cd KclLib
tree runtimes
dotnet build
dotnet pack
cd bin/Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
runs-on: ubuntu-latest
container:
image: "kcllang/kcl-java-builder-centos7:0.1.0"

permissions:
contents: read
packages: write
Expand Down
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,21 @@ public class ExecProgramTest {

### .NET

This library is currently under development [here](https://github.com/kcl-lang/lib/tree/main/dotnet)
```shell
dotnet add package KclLib
```

```csharp
namespace KclLib.Tests;
Write the code

```cs
using KclLib.API;

public class KclLibAPITest
{
public static void Main()
{
var execArgs = new ExecProgram_Args();
execArgs.KFilenameList.Add("path/to/kcl.k");
var result = new API().ExecProgram(execArgs);
Console.WriteLine(result.YamlResult);
}
}
var api = new API();
var execArgs = new ExecProgram_Args();
var path = Path.Combine("test_data", "schema.k");
execArgs.KFilenameList.Add(path);
var result = api.ExecProgram(execArgs);
Console.WriteLine(result.YamlResult);
```

### Python
Expand Down
19 changes: 19 additions & 0 deletions dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

This library is currently under development. Please check back later.

## Quick Start

```shell
dotnet add package KclLib
```

Write the code

```cs
using KclLib.API;

var api = new API();
var execArgs = new ExecProgram_Args();
var path = Path.Combine("test_data", "schema.k");
execArgs.KFilenameList.Add(path);
var result = api.ExecProgram(execArgs);
Console.WriteLine(result.YamlResult);
```

## Developing and Testing

- Install `cargo`
Expand Down

0 comments on commit a2e27f0

Please sign in to comment.