Skip to content

Commit 841e568

Browse files
Added csharp sdk.
1 parent 4d8cfb8 commit 841e568

File tree

6 files changed

+63
-2
lines changed

6 files changed

+63
-2
lines changed

.github/actions/build-sdk/action.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ runs:
3838
shell: bash
3939
run: mkdir swagger
4040

41+
- name: make csharp folder
42+
working-directory: ./sdk
43+
shell: bash
44+
run: mkdir csharp
45+
4146
- name: Build sdks
4247
working-directory: ./sdk
4348
shell: bash
@@ -73,6 +78,12 @@ runs:
7378
path: "sdk/python"
7479
name: sdk-python-${{ inputs.version }}
7580

81+
- name: Upload csharp artifact
82+
uses: actions/upload-artifact@v4
83+
with:
84+
path: "sdk/typescript"
85+
name: sdk-csharp-${{ inputs.version }}
86+
7687
# - name: Upload artifact
7788
# # Automatically uploads an artifact from the './_site' directory by default
7889
# uses: actions/upload-pages-artifact@v3

.github/workflows/stage-5-publish.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,25 @@ jobs:
147147
asset_name: sdk-python-${{ inputs.version }}.zip
148148
asset_content_type: "application/gzip"
149149

150+
151+
152+
153+
- name: "zip sdk csharp release asset"
154+
# Git hub pages needs a single tar called artifact inside the zip.
155+
working-directory: ./artifacts/sdk-csharp-${{ inputs.version }}
156+
run: zip -r ../sdk-csharp-${{ inputs.version }}.zip .
157+
shell: bash
158+
159+
- name: "Upload sdk csharp release asset"
160+
uses: actions/upload-release-asset@v1
161+
env:
162+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
163+
with:
164+
upload_url: "${{ steps.create_release.outputs.upload_url }}"
165+
asset_path: ./artifacts/sdk-csharp-${{ inputs.version }}.zip
166+
asset_name: sdk-csharp-${{ inputs.version }}.zip
167+
asset_content_type: "application/gzip"
168+
150169
- name: "zip api OAS specification release asset"
151170
# Git hub pages needs a single tar called artifact inside the zip.
152171
working-directory: ./artifacts/api-oas-specification-${{ inputs.version }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ If packages are unavailable the latest SDKs can be downloaded directly from:
6060
- Download SDKs from the [latest releases](https://github.com/NHSDigital/nhs-notify-supplier-api/releases)
6161
- Python `sdk-python-[Version].zip`
6262
- TypeScript `sdk-ts-[Version].zip`
63+
- CSharp `sdk-csharp-[Version].zip`
6364

6465
### Examples
6566

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@
4646
},
4747
"scripts": {
4848
"build": "npm run generate",
49-
"generate": "npm run generate:html && npm run generate:ts && npm run generate:python",
49+
"generate": "npm run generate:cs && npm run generate:html && npm run generate:ts && npm run generate:python",
5050
"generate-dependencies": "npm run generate-dependencies --workspaces --if-present",
51+
"generate:cs": "./sdk/generate-cs.sh",
5152
"generate:html": "docker run --rm --user $(id -u) -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/specification/api/notify-supplier.yml -g html -o /local/sdk/html --skip-validate-spec",
5253
"generate:python": "docker run --rm --user $(id -u) -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/specification/api/notify-supplier.yml -g python -o /local/sdk/python --skip-validate-spec",
5354
"generate:ts": "./sdk/generate-ts.sh",

sdk/_config.version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 0.2.0-20250703.153040+2ecf715
1+
version: 0.2.0-20250704.065308+4d8cfb8

sdk/generate-cs.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
# run this from directory above, or with npm run generate:ts from parent directory.
3+
4+
mkdir -p sdk/csharp
5+
6+
VERSION="$(cat .version)"
7+
echo $VERSION
8+
9+
set -x
10+
docker run \
11+
--rm \
12+
--user $(id -u) \
13+
-v ${PWD}:/local \
14+
-e VERSION="$VERSION" \
15+
openapitools/openapi-generator-cli \
16+
generate \
17+
-i /local/specification/api/notify-supplier.yml \
18+
-g csharp \
19+
--additional-properties="packageName=nhsnotifysupplier,packageVersion=$VERSION,licenseId=MIT,targetFramework=net8.0" \
20+
-o /local/sdk/csharp \
21+
--skip-validate-spec
22+
set +x
23+
24+
# sed -i -e 's|https://github.com/GIT_USER_ID/GIT_REPO_ID.git|https://github.com/NHSDigital/nhs-notify-supplier-api.git|g' ./sdk/typescript/package.json
25+
26+
# sed -i -e 's|OpenAPI client for nhsnotifysupplier|NHS Notify Supplier SDK|g' ./sdk/typescript/package.json
27+
# sed -i -e 's|OpenAPI-Generator Contributors|NHS Notify|g' ./sdk/typescript/package.json
28+
29+
# echo $VERSION

0 commit comments

Comments
 (0)