Add typescript client library generation CI for releases
Description
We would like to provide a system for automatically generating and releasing client code for APIs, based on their OpenAPI specifications.
Further details
We expect to publish a typescript client package to the repository's package registry when a release occurs.
The version for this generated library should match the one from the pyproject.toml
(but the specific mechanism is up to the implementer), and should respect that release-it
will be updating this.
We anticipate adding two jobs to pipelines that include this new template:
- A build step job to build the client library which runs alongside the normal build job, which runs in MR pipelines and the release pipeline
- A release step job to publish the client library to the repository's registry, which runs only in the release pipeline
In the future we expect to expand this capability to also publish (e.g.) Python client libraries as part of the release process, so work done on this issue should keep this in mind, but is primarily targeting Typescript client libraries.
We anticipate that this job(s) will need to be provided with variables to set:
- A build artefact or location for the OpenAPI specification
- A configuration file or command line options for the generator
This should make use of the docker image built as part of uis/devops/infra/dockerimages#100 (closed)
These job template are to be written out in a separate file under this repositories .gitlab
directory, and included in the .gitlab/webapp.gitlab-ci.yml
.
Any support files (e.g. configuration for the client library) necessary should be configurable in the CI pipelines through variables.
If the client does produce client documentation, and is trivial to publish alongside the library, we should do so alongside.
Task list
Acceptance criteria
-
Typescript client code (and documentation if available) is generated and published to repository registry on release