|
| 1 | +name: Build Extension |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 15 | + include: |
| 16 | + - os: ubuntu-latest |
| 17 | + platform: linux |
| 18 | + - os: windows-latest |
| 19 | + platform: win32 |
| 20 | + - os: macos-latest |
| 21 | + platform: darwin |
| 22 | + |
| 23 | + runs-on: ${{ matrix.os }} |
| 24 | + |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v3 |
| 27 | + |
| 28 | + - name: Setup Node.js |
| 29 | + uses: actions/setup-node@v3 |
| 30 | + with: |
| 31 | + node-version: '16' |
| 32 | + |
| 33 | + - name: Install dependencies |
| 34 | + run: npm ci |
| 35 | + |
| 36 | + - name: Build native modules |
| 37 | + run: node ./scripts/prepare-native-modules.js |
| 38 | + |
| 39 | + - name: Upload build artifacts |
| 40 | + uses: actions/upload-artifact@v3 |
| 41 | + with: |
| 42 | + name: native-modules-${{ matrix.platform }} |
| 43 | + path: build/${{ matrix.platform }}-* |
| 44 | + |
| 45 | + package: |
| 46 | + needs: build |
| 47 | + runs-on: ubuntu-latest |
| 48 | + |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v3 |
| 51 | + |
| 52 | + - name: Setup Node.js |
| 53 | + uses: actions/setup-node@v3 |
| 54 | + with: |
| 55 | + node-version: '16' |
| 56 | + |
| 57 | + - name: Install dependencies |
| 58 | + run: npm ci |
| 59 | + |
| 60 | + - name: Download all artifacts |
| 61 | + uses: actions/download-artifact@v3 |
| 62 | + with: |
| 63 | + path: build |
| 64 | + |
| 65 | + - name: Reorganize artifacts |
| 66 | + run: | |
| 67 | + mkdir -p build/win32-x64 |
| 68 | + mkdir -p build/darwin-x64 |
| 69 | + mkdir -p build/darwin-arm64 |
| 70 | + mkdir -p build/linux-x64 |
| 71 | + |
| 72 | + # Move artifacts to their correct locations |
| 73 | + find build/native-modules-win32 -name "*.node" -exec cp {} build/win32-x64/ \; |
| 74 | + find build/native-modules-darwin -name "*.node" -exec cp {} build/darwin-x64/ \; |
| 75 | + find build/native-modules-linux -name "*.node" -exec cp {} build/linux-x64/ \; |
| 76 | + |
| 77 | + - name: Package extension |
| 78 | + run: npx vsce package |
| 79 | + |
| 80 | + - name: Upload VSIX |
| 81 | + uses: actions/upload-artifact@v3 |
| 82 | + with: |
| 83 | + name: vibe-coder-extension |
| 84 | + path: "*.vsix" |
0 commit comments