Add build script to package.json #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Create Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: '**/package-lock.json' | |
| - name: Update Version from Tag | |
| run: | | |
| VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//') | |
| echo "Version = $VERSION" | |
| sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" package.json | |
| - name: Build MCP Server | |
| run: | | |
| npm ci | |
| npx tsc | |
| - name: Prepare release directory | |
| run: | | |
| mkdir -p release/pkg | |
| # Copy necessary files for runtime | |
| cp -r dist release/pkg/ | |
| cp package.json release/pkg/ | |
| cp package-lock.json release/pkg/ | |
| # Include documentation | |
| cp README.md release/pkg/ 2>/dev/null || touch release/pkg/README.md | |
| - name: Create release assets | |
| run: | | |
| cd release/pkg | |
| zip -r ../adb-mcp-server-v${{ github.ref_name }}.zip . | |
| tar -czf ../adb-mcp-server-v${{ github.ref_name }}.tar.gz . | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| release/adb-mcp-server-v${{ github.ref_name }}.zip | |
| release/adb-mcp-server-v${{ github.ref_name }}.tar.gz | |
| body: | | |
| ## ADB MCP Server ${{ github.ref_name }} (Super-Evolving 3.0) | |
| ### Tính năng nổi bật: | |
| - **Semantic UI Mapping**: Tự động nhận diện nút bấm qua ID/Text, không lo app đổi giao diện. | |
| - **SQLite Knowledge Base**: Lưu trữ tri thức quy mô lớn, truy vấn cực nhanh. | |
| - **Auto-Recovery**: Tự động tìm lại tọa độ khi nút bấm bị di chuyển. | |
| - **Batch Execution**: Gửi nhiều lệnh ADB cùng lúc để giảm độ trễ. | |
| ### Hướng dẫn cài đặt: | |
| 1. Tải bản phát hành phù hợp với hệ điều hành của bạn. | |
| 2. Giải nén và chạy `npm install --production`. | |
| 3. Khởi động server: `node dist/index.js`. | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |