Feat: Introduce update_assets tool, full NFS compatibility and MCP to… #10
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: Publish to npm | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: read | |
| id-token: write # required for --provenance (OIDC) | |
| jobs: | |
| publish: | |
| name: Build & Publish | |
| runs-on: ubuntu-latest | |
| env: | |
| NODE_OPTIONS: --max-old-space-size=4096 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Set version from tag | |
| run: | | |
| node << 'EOF' | |
| const fs = require('fs'); | |
| const tag = process.env.GITHUB_REF_NAME; | |
| const version = tag.startsWith('v') ? tag.slice(1) : tag; | |
| const plugins = ['dev-ai-hub-common', 'dev-ai-hub-node', 'dev-ai-hub-backend', 'dev-ai-hub']; | |
| const names = new Set( | |
| plugins.map(p => JSON.parse(fs.readFileSync(`plugins/${p}/package.json`, 'utf8')).name) | |
| ); | |
| for (const plugin of plugins) { | |
| const pkgPath = `plugins/${plugin}/package.json`; | |
| const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); | |
| pkg.version = version; | |
| for (const field of ['dependencies', 'devDependencies', 'peerDependencies']) { | |
| if (pkg[field]) { | |
| for (const dep of Object.keys(pkg[field])) { | |
| if (names.has(dep)) pkg[field][dep] = `^${version}`; | |
| } | |
| } | |
| } | |
| fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n'); | |
| console.log(`Updated ${pkgPath} to ${version}`); | |
| } | |
| EOF | |
| - name: Lint | |
| run: yarn lint:all | |
| - name: Test | |
| run: yarn test | |
| - name: Build all packages | |
| run: yarn build:all | |
| # Publish in dependency order: common → node → backend → frontend | |
| - name: Publish dev-ai-hub-common | |
| working-directory: plugins/dev-ai-hub-common | |
| run: npm publish --provenance --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Publish dev-ai-hub-node | |
| working-directory: plugins/dev-ai-hub-node | |
| run: npm publish --provenance --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Publish dev-ai-hub-backend | |
| working-directory: plugins/dev-ai-hub-backend | |
| run: npm publish --provenance --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Publish dev-ai-hub (frontend) | |
| working-directory: plugins/dev-ai-hub | |
| run: npm publish --provenance --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |