使用官方 setup-bun
GitHub Action 在 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
- run: bun index.ts
- run: bun run build
指定要安裝的 Bun 版本
name: my-workflow
jobs:
my-job:
name: my-job
runs-on: ubuntu-latest
steps:
# ...
- uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.11 # or "latest", "canary", <sha>
參閱 README.md 以取得 setup-bun
GitHub Action 的完整文件。