Skip to content

Commit 272bd8a

Browse files
Trying the npm publish.
1 parent 0ea9d9a commit 272bd8a

File tree

7 files changed

+97
-123
lines changed

7 files changed

+97
-123
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
},
1010
"vscode": {
1111
"extensions": [
12+
"42crunch.vscode-openapi",
1213
"alefragnani.bookmarks",
1314
"AmazonWebServices.aws-toolkit-vscode",
1415
"chdsbd.github-code-owners",

.devcontainer/devcontainer_copy.json

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

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ runs:
4343
shell: bash
4444
run: make build
4545

46+
- name: Upload API OAS specification artifact
47+
uses: actions/upload-artifact@v4
48+
with:
49+
path: "specification/api"
50+
name: api-oas-specification-${{ inputs.version }}
51+
4652
- name: Upload html artifact
4753
uses: actions/upload-artifact@v4
4854
with:

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

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

149+
- name: "Upload api OAS specification release asset"
150+
uses: actions/upload-release-asset@v1
151+
env:
152+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
153+
with:
154+
upload_url: "${{ steps.create_release.outputs.upload_url }}"
155+
asset_path: ./artifacts/api-oas-specification-${{ inputs.version }}.zip
156+
asset_name: api-oas-specification-${{ inputs.version }}.zip
157+
asset_content_type: "application/gzip"
158+
159+
160+
### Publish NPM
161+
162+
publishnpm:
163+
name: "Publish npm packages to npm.pkg.github.com"
164+
runs-on: ubuntu-latest
165+
steps:
166+
- name: "Get the artefacts"
167+
uses: actions/download-artifact@v4
168+
with:
169+
path: ./artifacts
170+
- uses: actions/setup-node@v4
171+
with:
172+
node-version: '20.x'
173+
registry-url: 'https://npm.pkg.github.com'
174+
175+
- run: npm ci
176+
working-directory: ./artifacts/sdk-ts-${{ inputs.version }}
177+
- run: npm publish
178+
working-directory: ./artifacts/sdk-ts-${{ inputs.version }}
179+
env:
180+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
181+
182+
183+
149184

150185
# - name: "Upload other release asset 1"
151186
# uses: actions/upload-release-asset@v1

README.md

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,44 @@ This repository documents the Supplier API specification and provides an SDK wit
1919
- [NHS Notify Supplier API](#nhs-notify-supplier-api)
2020
- [OAS Specifications](#oas-specifications)
2121
- [Table of Contents](#table-of-contents)
22-
- [Documentation](#documentation)
23-
- [Setup](#setup)
24-
- [Prerequisites and Configuration](#prerequisites-and-configuration)
25-
- [Build](#build)
26-
- [GitHub Actions CI/CD](#github-actions-cicd)
27-
- [CI (Automatic)](#ci-automatic)
28-
- [CD (Manual)](#cd-manual)
22+
- [API Consumers - Getting Started](#api-consumers---getting-started)
23+
- [API Developers](#api-developers)
24+
- [Documentation](#documentation)
25+
- [Setup](#setup)
26+
- [Prerequisites and Configuration](#prerequisites-and-configuration)
27+
- [Build](#build)
28+
- [GitHub Actions CI/CD](#github-actions-cicd)
29+
- [CI (Automatic)](#ci-automatic)
30+
- [CD (Manual)](#cd-manual)
2931
- [Licence](#licence)
3032

31-
## Documentation
33+
## API Consumers - Getting Started
34+
35+
- View the [latest SDK documentation](https://nhsdigital.github.io/nhs-notify-supplier-api/)
36+
- Download SDKs from the [latest releases](https://github.com/NHSDigital/nhs-notify-supplier-api/releases)
37+
- Python `sdk-python-[Version].zip`
38+
- TypeScript `sdk-ts-[Version].zip`
39+
- Download the OAS Specification File from the [latest releases](https://github.com/NHSDigital/nhs-notify-supplier-api/releases)
40+
- OAS JSON files `api-oas-specification-[Version].zip`
41+
- Download local versions of the API docs from the [latest releases](https://github.com/NHSDigital/nhs-notify-supplier-api/releases)
42+
- HTML `sdk-html-[Version].zip`
43+
- Swagger `sdk-swagger-[Version].zip`
44+
45+
TODO: Links to example clients.
46+
47+
## API Developers
48+
49+
New developer of the NHS Notify Supplier API
50+
should understand the below.
51+
52+
### Documentation
3253

3354
- [Built](/)
3455
- [Source](/docs/README.md)
3556

36-
## Setup
57+
### Setup
3758

38-
### Prerequisites and Configuration
59+
#### Prerequisites and Configuration
3960

4061
- Utilised the devcontainer, for pre reqs and configuration.
4162
- You should open in a devcontainer or a Github workspaces.
@@ -46,7 +67,7 @@ This repository documents the Supplier API specification and provides an SDK wit
4667
and will be built as part of the CI/CD pipeline and released as a GitHub
4768
release.
4869

49-
## Build
70+
### Build
5071

5172
To generate the SDK folder from changes to the [specification/api/notify-supplier.yml](specification/api/notify-supplier.yml) OAS specification:
5273

@@ -71,9 +92,9 @@ by default they will be available at [http://localhost:3050](http://localhost:30
7192

7293
These are generated using [https://hub.docker.com/r/openapitools/openapi-generator-cli](https://hub.docker.com/r/openapitools/openapi-generator-cli)
7394

74-
## GitHub Actions CI/CD
95+
### GitHub Actions CI/CD
7596

76-
### CI (Automatic)
97+
#### CI (Automatic)
7798

7899
PRs will run the [CI workflow](https://github.com/NHSDigital/nhs-notify-supplier-api/actions/workflows/cicd-1-pull-request.yaml)
79100
for testing.
@@ -83,7 +104,7 @@ will generate a
83104
[pre-release](https://github.com/NHSDigital/nhs-notify-supplier-api/releases)
84105
based on the date and the commit hash.
85106

86-
### CD (Manual)
107+
#### CD (Manual)
87108

88109
Deployments can be made of any [release](https://github.com/NHSDigital/nhs-notify-supplier-api/releases)
89110
(including the GitHub pages) by running the CD pipeline

project.code-workspace

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
},
9090
"extensions": {
9191
"recommendations": [
92+
"42crunch.vscode-openapi",
9293
"alefragnani.bookmarks",
9394
"AmazonWebServices.aws-toolkit-vscode",
9495
"chdsbd.github-code-owners",

specification/api/notify-supplier-next.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
openapi: 3.1.0
1+
openapi: 3.1.1
22
info:
33
version: next
44
title: NHS Notify Supplier API
@@ -414,7 +414,8 @@ paths:
414414
- whitemail
415415
x-stoplight:
416416
id: lmbg85kro8iwy
417-
/data:
417+
418+
'/data':
418419
parameters:
419420
- $ref: '#/components/parameters/requestId'
420421
- $ref: '#/components/parameters/correlationId'
@@ -423,19 +424,17 @@ paths:
423424
operationId: post-data
424425
tags:
425426
- data
427+
428+
'/data2/{id}':
429+
parameters:
430+
- $ref: '#/components/parameters/id'
431+
get:
432+
operationId: getdata2
433+
426434
'/data/{id}':
427435
parameters:
428-
- schema:
429-
type: string
430-
name: id
431-
in: path
432-
required: true
433-
- name: id
434-
in: path
435-
description: Unique identifier of this resource
436-
required: true
437-
schema:
438-
type: string
436+
- $ref: '#/components/parameters/id'
437+
439438
- name: X-Request-ID
440439
in: header
441440
description: 'Unique request identifier, in the format of a GUID'
@@ -444,6 +443,7 @@ paths:
444443
type: string
445444
examples:
446445
- dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2
446+
447447
- name: X-Correlation-ID
448448
in: header
449449
description: |-
@@ -462,6 +462,8 @@ paths:
462462
x-stoplight:
463463
id: 98lwlebl1vxeq
464464
responses:
465+
'404':
466+
description: Not Found
465467
'303':
466468
description: See Other
467469
headers:
@@ -473,7 +475,9 @@ paths:
473475
summary: Fetch data file metadata
474476
tags:
475477
- data
476-
responses: {}
478+
responses:
479+
200:
480+
description: OK
477481
operationId: head-data-id
478482
x-stoplight:
479483
id: tdjs72iaaavub
@@ -500,8 +504,8 @@ components:
500504
examples:
501505
- 11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA
502506
id:
503-
name: id
504507
in: path
508+
name: id
505509
description: Unique identifier of this resource
506510
required: true
507511
schema:

0 commit comments

Comments
 (0)