| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- name: Build CLI package
- on:
- push:
- branches: [main]
- pull_request:
- branches: [main]
- workflow_dispatch:
- env:
- GIT_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'main' }}
- NODE_VERSION: 20.20.0
- PNPM_VERSION: 10.8.1
- TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
- TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
- jobs:
- build-cli:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
- - name: Install pnpm
- uses: pnpm/action-setup@v4
- with:
- version: ${{ env.PNPM_VERSION }}
- - name: Setup Node.js
- uses: actions/setup-node@v6
- with:
- node-version: ${{ env.NODE_VERSION }}
- cache: "pnpm"
- - name: Turbo cache setup
- uses: actions/cache@v5
- with:
- path: .turbo
- key: ${{ runner.os }}-turbo-${{ github.sha }}
- restore-keys: |
- ${{ runner.os }}-turbo-
- - name: Install dependencies
- run: pnpm install
- - name: Create .env file
- run: echo "KILOCODE_POSTHOG_API_KEY=${{ secrets.POSTHOG_API_KEY }}" >> .env
- working-directory: cli
- - name: Build
- run: pnpm run cli:bundle
- shell: bash
- - name: NPM Pack
- run: npm pack
- working-directory: cli/dist
- - name: Upload artifact
- uses: actions/upload-artifact@v6
- with:
- name: tarball
- path: cli/dist/*.tgz
|