Create a multi-platform pipeline
This is a step-by-step guide to using Azure Pipelines to build on macOS, Linux, and Windows.
- You need an Azure DevOps organization. If you don't have one, you can create one for free. If your team already has one, then make sure you're an administrator of the Azure DevOps project that you want to use. (An Azure DevOps organization is different from your GitHub organization. Give them the same name if you want alignment between them.)
- You need a GitHub account, where you can create a repository.
Get the sample code
You can use Azure Pipelines to build an app on written in any language, on multiple platforms at the same time.
Fork the repo into your own GitHub account.
You should now have a sample app in your GitHub account.
Add additional platforms
In the sample repo, the Node.js app is configured to run on Ubuntu Linux. You're going to add additional jobs that run on other platforms.
Go to your fork of the sample code on GitHub.
azure-pipelines.yml, and then select the Edit this file pencil icon.
In GitHub's web editor, replace the existing content with the content below.
At the bottom of the GitHub editor, select Commit changes.
Each job in this example runs on a different VM image. By default, the jobs run at the same time in parallel.
script runs in each platform's native script interpreter: Bash on macOS and Linux, CMD on Windows.
See multi-platform scripts to learn more.
Create the pipeline
Now that you've configured your GitHub repo with a pipeline, you're ready to build it.
Sign in to your Azure DevOps organization and navigate to your project.
In your project, go to the Pipelines page, and then select New pipeline.
Select GitHub as the location of your source code.
For Repository, select Authorize and then Authorize with OAuth.
You might be redirected to GitHub to sign in. If this happens, then enter your GitHub credentials. After you're redirected back to Azure Pipelines, select the sample app repository.
For the Template, Azure Pipelines analyzes the code in your repository. If your repository already contains an
azure-pipelines.ymlfile (as in this case), then this step is skipped. Otherwise, Azure Pipelines recommends a starter template based on the code in your repository.
Azure Pipelines shows you the YAML file that it will use to create your pipeline.
Select Save and run, and then select the option to Commit directly to the master branch.
The YAML file is pushed to your GitHub repository, and a new build is automatically started. Wait for the build to finish.
You've just learned the basics of using multiple platforms with Azure Pipelines. From here, you can learn more about:
- Running multiple jobs
- Cross-platform scripting
- Templates to remove the duplication
- Building Node.js apps
- Building .NET Core, Go, Java, or Python apps
For details about building GitHub repositories, see Build GitHub repositories.
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.