Using Build Pipelines with TypeSpec
This doc will help you get started with using TypeSpec in your build pipelines in your own repository. See here for more how to use in the azure-rest-api-specs repo
Table of Contents
Introduction
Dependencies
In order to build TypeSpec in your build pipeline, you will need to ensure that the following are available or are automatically installed by your project:
- NodeJS 18.x LTS (Recommended)
- TypeSpec compilation tools (via npm package)
Azure DevOps Pipelines
Depending on your project, you may need to add NodeJS and install NPM packages for TypeSpec. The following Azure Devops Pipeline tasks can be modified and added to your pipeline yaml file if you do not already utilize NodeJS in your project.
This is sufficient if you are building via a csproj file which triggers the tsp compile and finds the tsp compiler itself.
You may also need to add additional steps to compile your typespec files separately. An example of a basic pipeline is provided below.
Example Pipeline Configuration
Note: This example assumes that your TypeSpec folder is at the root of your repository.