|
| 1 | +name: Build and Publish MITRE Continue CLI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - mitre/fix-authentication-and-config-bugs |
| 7 | + tags: |
| 8 | + - 'mitre-v*' |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: read |
| 13 | + packages: write |
| 14 | + |
| 15 | +jobs: |
| 16 | + build-and-publish: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Checkout code |
| 21 | + uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Setup Node.js |
| 24 | + uses: actions/setup-node@v4 |
| 25 | + with: |
| 26 | + node-version: '22' |
| 27 | + registry-url: 'https://npm.pkg.github.com' |
| 28 | + scope: '@mitre' |
| 29 | + |
| 30 | + - name: Install dependencies |
| 31 | + run: npm install |
| 32 | + |
| 33 | + - name: Build packages |
| 34 | + run: node ./scripts/build-packages.js |
| 35 | + |
| 36 | + - name: Build CLI |
| 37 | + working-directory: extensions/cli |
| 38 | + run: npm run build |
| 39 | + |
| 40 | + - name: Update package.json for GitHub registry |
| 41 | + working-directory: extensions/cli |
| 42 | + run: | |
| 43 | + # Update package name to @mitre/continue-cli for GitHub registry |
| 44 | + node -e " |
| 45 | + const fs = require('fs'); |
| 46 | + const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); |
| 47 | + pkg.name = '@mitre/continue-cli'; |
| 48 | + pkg.version = '1.0.0-mitre.' + Date.now(); |
| 49 | + pkg.description = 'MITRE patched Continue CLI with x-api-key authentication fix'; |
| 50 | + pkg.repository = { |
| 51 | + type: 'git', |
| 52 | + url: 'https://github.com/mitre/continue.git' |
| 53 | + }; |
| 54 | + fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2)); |
| 55 | + " |
| 56 | +
|
| 57 | + - name: Publish to GitHub Packages |
| 58 | + working-directory: extensions/cli |
| 59 | + run: npm publish |
| 60 | + env: |
| 61 | + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 62 | + |
| 63 | + - name: Create distribution tarball |
| 64 | + working-directory: extensions/cli |
| 65 | + run: | |
| 66 | + npm pack |
| 67 | + mv *.tgz continuedev-cli-mitre-patched.tgz |
| 68 | +
|
| 69 | + - name: Upload artifact |
| 70 | + uses: actions/upload-artifact@v4 |
| 71 | + with: |
| 72 | + name: mitre-continue-cli |
| 73 | + path: extensions/cli/continuedev-cli-mitre-patched.tgz |
| 74 | + retention-days: 90 |
| 75 | + |
| 76 | + - name: Create Release (on tag push) |
| 77 | + if: startsWith(github.ref, 'refs/tags/mitre-v') |
| 78 | + uses: softprops/action-gh-release@v1 |
| 79 | + with: |
| 80 | + files: extensions/cli/continuedev-cli-mitre-patched.tgz |
| 81 | + body: | |
| 82 | + MITRE Patched Continue CLI |
| 83 | +
|
| 84 | + Includes fix for x-api-key duplicate header authentication bug. |
| 85 | +
|
| 86 | + **Installation:** |
| 87 | + ```bash |
| 88 | + npm install -g continuedev-cli-mitre-patched.tgz |
| 89 | + ``` |
| 90 | +
|
| 91 | + **Or from GitHub Packages:** |
| 92 | + ```bash |
| 93 | + npm install -g @mitre/continue-cli@latest --registry=https://npm.pkg.github.com |
| 94 | + ``` |
| 95 | +
|
| 96 | + See MITRE-AIP-SOLUTION.md for complete setup instructions. |
| 97 | + env: |
| 98 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments