Skip to content

Commit 2920feb

Browse files
committed
fix: dotnet lib build folder
Signed-off-by: peefy <[email protected]>
1 parent e414c17 commit 2920feb

File tree

5 files changed

+47
-66
lines changed

5 files changed

+47
-66
lines changed

.github/workflows/cla.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/dotnet-test.yaml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,14 @@ jobs:
100100
cargo build --release --target ${{ matrix.target }}
101101
102102
- name: 'Upload artifact'
103-
uses: actions/upload-artifact@v3
103+
uses: actions/upload-artifact@v4
104104
with:
105105
name: kcl-lib-${{ matrix.classifier }}
106-
path: |
107-
target/release/${{ matrix.target }}/${{ matrix.lib-name }}
106+
if-no-files-found: error
107+
path: ${{ github.workspace }}/dotnet/target/${{ matrix.target }}/release/${{ matrix.lib-name }}
108108

109109
deploy:
110+
name: Deploy KCL .NET Library to Nuget
110111
runs-on: ubuntu-latest
111112

112113
permissions:
@@ -127,39 +128,40 @@ jobs:
127128
components: clippy, rustfmt
128129

129130
- name: Download windows x86_64 lib
130-
uses: actions/download-artifact@v3
131+
uses: actions/download-artifact@v4
131132
with:
132133
name: kcl-lib-win-x64
133-
path: KclLib/runtimes/win-x64/native
134+
path: dotnet/KclLib/runtimes/win-x64/native
134135

135136
- name: Download linux aarch_64 lib
136-
uses: actions/download-artifact@v3
137+
uses: actions/download-artifact@v4
137138
with:
138139
name: kcl-lib-linux-arm64
139-
path: KclLib/runtimes/linux-arm64/native
140+
path: dotnet/KclLib/runtimes/linux-arm64/native
140141

141142
- name: Download linux x86_64 lib
142-
uses: actions/download-artifact@v3
143+
uses: actions/download-artifact@v4
143144
with:
144145
name: kcl-lib-linux-x64
145-
path: KclLib/runtimes/linux-x64/native
146+
path: dotnet/KclLib/runtimes/linux-x64/native
146147

147148
- name: Download darwin x86_64 lib
148-
uses: actions/download-artifact@v3
149+
uses: actions/download-artifact@v4
149150
with:
150151
name: kcl-lib-osx-x64
151-
path: KclLib/runtimes/osx-x64/native
152+
path: dotnet/KclLib/runtimes/osx-x64/native
152153

153154
- name: Download darwin aarch_64 lib
154-
uses: actions/download-artifact@v3
155+
uses: actions/download-artifact@v4
155156
with:
156157
name: kcl-lib-osx-arm64
157-
path: KclLib/runtimes/osx-arm64/native
158+
path: dotnet/KclLib/runtimes/osx-arm64/native
158159

159160
- name: Release to Nuget
160161
# if: "startsWith(github.ref, 'refs/tags/')"
161162
run: |
162-
cd KclLib
163+
cd dotnet/KclLib
164+
tree runtimes
163165
dotnet build
164166
dotnet pack
165167
cd bin/Release

.github/workflows/java-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
runs-on: ubuntu-latest
9393
container:
9494
image: "kcllang/kcl-java-builder-centos7:0.1.0"
95-
95+
9696
permissions:
9797
contents: read
9898
packages: write

README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,23 +108,21 @@ public class ExecProgramTest {
108108

109109
### .NET
110110

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

113-
```csharp
114-
namespace KclLib.Tests;
115+
Write the code
115116

117+
```cs
116118
using KclLib.API;
117119

118-
public class KclLibAPITest
119-
{
120-
public static void Main()
121-
{
122-
var execArgs = new ExecProgram_Args();
123-
execArgs.KFilenameList.Add("path/to/kcl.k");
124-
var result = new API().ExecProgram(execArgs);
125-
Console.WriteLine(result.YamlResult);
126-
}
127-
}
120+
var api = new API();
121+
var execArgs = new ExecProgram_Args();
122+
var path = Path.Combine("test_data", "schema.k");
123+
execArgs.KFilenameList.Add(path);
124+
var result = api.ExecProgram(execArgs);
125+
Console.WriteLine(result.YamlResult);
128126
```
129127

130128
### Python

dotnet/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

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

5+
## Quick Start
6+
7+
```shell
8+
dotnet add package KclLib
9+
```
10+
11+
Write the code
12+
13+
```cs
14+
using KclLib.API;
15+
16+
var api = new API();
17+
var execArgs = new ExecProgram_Args();
18+
var path = Path.Combine("test_data", "schema.k");
19+
execArgs.KFilenameList.Add(path);
20+
var result = api.ExecProgram(execArgs);
21+
Console.WriteLine(result.YamlResult);
22+
```
23+
524
## Developing and Testing
625

726
- Install `cargo`

0 commit comments

Comments
 (0)