Skip to content

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

yaml
name: my-workflow
jobs:
  my-job:
    name: my-job
    runs-on: ubuntu-latest
    steps:
      # ...
      - uses: actions/checkout@v4
      - uses: oven-sh/setup-bun@v2

      # 運行任何 `bun` 或 `bunx` 命令
      - run: bun install
      - run: bun index.ts
      - run: bun run build

要指定要安裝的 Bun 版本:

yaml
name: my-workflow
jobs:
  my-job:
    name: my-job
    runs-on: ubuntu-latest
    steps:
      # ...
      - uses: oven-sh/setup-bun@v2
        with: 
          bun-version: 1.3.3 # 或 "latest"、"canary"、<sha> 

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

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