使用官方 setup-bun
GitHub 操作在 GitHub Actions 运行器中安装 bun
。
name: my-workflow
jobs:
my-job:
name: my-job
runs-on: ubuntu-latest
steps:
# ...
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
# run any `bun` or `bunx` command
- run: bun install
要指定要安装的 Bun 版本
name: my-workflow
jobs:
my-job:
name: my-job
runs-on: ubuntu-latest
steps:
# ...
- uses: oven-sh/setup-bun@v1
with:
version: 0.7.0 # or "canary"
参阅 README.md 以获取 setup-bun
GitHub 操作的完整文档。