How to install Bun
I use Azure Pipelines for much of my day to day work. However, my OSS work is (unsurprisingly) all GitHub oriented. Using Bun in GitHub Actions is straightforward; you just make use of the Setup Bun GitHub Action to install Bun and you're off to the races. There isn't an equivalent for Azure Pipelines but that doesn't matter.
It turns out there's a great variety of ways to install Bun. However the simplest of the lot is to install it via npm, like so:
npm install -g bun
This installs the
bun command globally from the
Using Bun in Azure Pipelines
Since there's already a dedicated Azure Pipelines task for npm, we can use that to install Bun. Here's an example of how to do that:
- task: Npm@1
displayName: setup bun
customCommand: 'install -g bun'
Now we're able to use Bun in our Azure Pipelines. Here's an example of how to use it to install dependencies and run a build:
- bash: bun install
- bash: bun run build