Skip to content

使用官方的 setup-bun GitHub Action 在你的 GitHub Actions 運行器中安裝 bun

yaml
title: my-workflow
jobs:
  my-job:
    title: my-job
    runs-on: ubuntu-latest
    steps:
      # ...
      - uses: actions/checkout@v4
      - uses: oven-sh/setup-bun@v2 // [!code ++]

      # 運行任何 `bun` 或 `bunx` 命令
      - run: bun install // [!code ++]

要指定要安裝的 Bun 版本:

yaml
title: my-workflow
jobs:
  my-job:
    title: my-job
    runs-on: ubuntu-latest
    steps:
      # ...
      - uses: oven-sh/setup-bun@v2
         with: 
          version: "latest" # 或 "canary" 

請參閱 setup-bun GitHub Action 的 README.md 獲取完整文檔。

Bun學習網由www.bunjs.com.cn整理維護