|
11 | 11 | type: boolean |
12 | 12 | required: true |
13 | 13 | default: false |
14 | | - description: 'Push the release to all channels (GitHub, PyPI)' |
| 14 | + description: 'Push the release to all channels (GitHub, NuGet, PyPI)' |
15 | 15 |
|
16 | 16 | jobs: |
17 | 17 | c_cpp_build: |
|
61 | 61 | dist/sourcepp_*c.dylib |
62 | 62 | lang/c/include/ |
63 | 63 |
|
| 64 | + csharp_build: |
| 65 | + name: '[C#] Build' |
| 66 | + needs: |
| 67 | + - c_cpp_build |
| 68 | + runs-on: ubuntu-latest |
| 69 | + defaults: |
| 70 | + run: |
| 71 | + working-directory: '${{github.workspace}}/lang/csharp' |
| 72 | + steps: |
| 73 | + - name: Checkout Repository |
| 74 | + uses: actions/checkout@v6 |
| 75 | + |
| 76 | + - name: Setup .NET Core |
| 77 | + uses: actions/setup-dotnet@v5 |
| 78 | + with: |
| 79 | + dotnet-version: '10' |
| 80 | + |
| 81 | + - name: Configure CMake |
| 82 | + working-directory: '${{github.workspace}}' |
| 83 | + run: cmake -G "Ninja" -B build -DCMAKE_BUILD_TYPE=Release -DSOURCEPP_BUILD_CSHARP_WRAPPERS=ON -DSOURCEPP_VERSION="${{inputs.version}}" |
| 84 | + |
| 85 | + - name: Download C DLLs |
| 86 | + uses: actions/download-artifact@v8 |
| 87 | + with: |
| 88 | + pattern: 'c-dist-*' |
| 89 | + path: '${{github.workspace}}/out' |
| 90 | + merge-multiple: true |
| 91 | + |
| 92 | + - name: Copy C DLLs |
| 93 | + working-directory: '${{github.workspace}}' |
| 94 | + run: cp -a "${{github.workspace}}/out/dist/." "${{github.workspace}}/lang/csharp/src/" |
| 95 | + |
| 96 | + - name: Build Package |
| 97 | + run: | |
| 98 | + dotnet build --configuration Release --no-restore |
| 99 | + dotnet pack --configuration Release |
| 100 | +
|
| 101 | + - name: Upload Artifact |
| 102 | + uses: actions/upload-artifact@v7 |
| 103 | + with: |
| 104 | + name: csharp-dist |
| 105 | + path: | |
| 106 | + lang/csharp/src/bin/Release/sourcepp.*.nupkg |
| 107 | +
|
| 108 | + - name: Upload to NuGet |
| 109 | + if: inputs.release |
| 110 | + run: echo "Hello World" |
| 111 | + |
64 | 112 | python_build_sdist: |
65 | 113 | name: '[Python] Build SDist' |
66 | 114 | runs-on: ubuntu-latest |
@@ -151,6 +199,7 @@ jobs: |
151 | 199 | if: inputs.release |
152 | 200 | needs: |
153 | 201 | - c_cpp_build |
| 202 | + - csharp_build |
154 | 203 | - python_build_sdist |
155 | 204 | - python_build_bdist |
156 | 205 | runs-on: ubuntu-latest |
|
0 commit comments