wiki & cleanup #1
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: Publish Devbox MCP Server | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| dry_run: | |
| description: 'Dry run (do not publish)' | |
| type: boolean | |
| default: false | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'plugins/devbox-mcp/**' | |
| - '.github/workflows/publish-mcp.yml' | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| cancel-in-progress: false | |
| jobs: | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: plugins/devbox-mcp/package.json | |
| - name: Install Devbox | |
| uses: jetify-com/devbox-install-action@v0.14.0 | |
| with: | |
| enable-cache: true | |
| - name: Run devbox-mcp tests | |
| run: devbox run test:plugin:devbox-mcp | |
| - name: Upload reports and logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-reports | |
| path: | | |
| test-results/ | |
| reports/ | |
| retention-days: 7 | |
| release: | |
| name: Semantic Release | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 10 | |
| needs: test | |
| if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && !inputs.dry_run) | |
| environment: | |
| name: npm-publish | |
| url: https://www.npmjs.com/package/devbox-mcp | |
| outputs: | |
| new_release_published: ${{ steps.semantic.outputs.new_release_published }} | |
| new_release_version: ${{ steps.semantic.outputs.new_release_version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| working-directory: plugins/devbox-mcp | |
| run: npm ci | |
| - name: Install semantic-release | |
| run: npm install -g semantic-release @semantic-release/git @semantic-release/changelog @semantic-release/exec | |
| - name: Run semantic-release | |
| id: semantic | |
| working-directory: plugins/devbox-mcp | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| npx semantic-release | |
| - name: Upload release info | |
| if: steps.semantic.outputs.new_release_published == 'true' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-info | |
| path: plugins/devbox-mcp/CHANGELOG.md | |
| retention-days: 30 | |
| dry-run: | |
| name: Semantic Release (Dry Run) | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 10 | |
| needs: test | |
| if: github.event_name == 'workflow_dispatch' && inputs.dry_run | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| working-directory: plugins/devbox-mcp | |
| run: npm ci | |
| - name: Install semantic-release | |
| run: npm install -g semantic-release @semantic-release/git @semantic-release/changelog @semantic-release/exec | |
| - name: Run semantic-release (dry run) | |
| working-directory: plugins/devbox-mcp | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| echo "::notice::Running semantic-release in dry-run mode" | |
| npx semantic-release --dry-run | |
| summary: | |
| name: Publish Summary | |
| runs-on: ubuntu-latest | |
| needs: [test, release] | |
| if: always() && needs.release.result != 'skipped' | |
| steps: | |
| - name: Summary | |
| run: | | |
| echo "📦 Devbox MCP Server Publish Summary" | |
| echo "=====================================" | |
| echo "" | |
| echo "Tests: ${{ needs.test.result }}" | |
| echo "Release: ${{ needs.release.result }}" | |
| echo "" | |
| if [[ "${{ needs.release.outputs.new_release_published }}" == "true" ]]; then | |
| VERSION="${{ needs.release.outputs.new_release_version }}" | |
| echo "::notice::✅ Successfully published devbox-mcp@$VERSION" | |
| echo "" | |
| echo "NPM: https://www.npmjs.com/package/devbox-mcp/v/$VERSION" | |
| echo "Release: https://github.com/${{ github.repository }}/releases/tag/v$VERSION" | |
| elif [[ "${{ needs.release.result }}" == "success" ]]; then | |
| echo "::notice::ℹ️ No new release (no changes requiring a release)" | |
| else | |
| echo "::error::❌ Release workflow failed" | |
| exit 1 | |
| fi |