Merge pull request #66 from yogyam/feature/ecommerce-search-example #83
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 Alpha | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| publish-alpha: | |
| # Run on main push OR PRs from KushagraAgarwal525 | |
| if: | | |
| github.event_name == 'push' || | |
| github.event.pull_request.user.login == 'KushagraAgarwal525' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Configure npm for legacy peer deps | |
| run: echo "legacy-peer-deps=true" > .npmrc | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Check formatting | |
| run: npm run format:check | |
| - name: Get short SHA | |
| id: sha | |
| run: echo "short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| - name: Publish @leanmcp/utils (alpha) | |
| continue-on-error: true | |
| working-directory: packages/utils | |
| run: | | |
| CURRENT_VERSION=$(node -p "require('./package.json').version") | |
| ALPHA_VERSION="${CURRENT_VERSION}-alpha.${GITHUB_RUN_NUMBER}.${SHORT_SHA}" | |
| npm version $ALPHA_VERSION --no-git-tag-version | |
| npm run build | |
| npm publish --tag alpha --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| SHORT_SHA: ${{ steps.sha.outputs.short }} | |
| - name: Publish @leanmcp/env-injection (alpha) | |
| continue-on-error: true | |
| working-directory: packages/env-injection | |
| run: | | |
| CURRENT_VERSION=$(node -p "require('./package.json').version") | |
| ALPHA_VERSION="${CURRENT_VERSION}-alpha.${GITHUB_RUN_NUMBER}.${SHORT_SHA}" | |
| npm version $ALPHA_VERSION --no-git-tag-version | |
| npm run build | |
| npm publish --tag alpha --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| SHORT_SHA: ${{ steps.sha.outputs.short }} | |
| - name: Publish @leanmcp/elicitation (alpha) | |
| continue-on-error: true | |
| working-directory: packages/elicitation | |
| run: | | |
| CURRENT_VERSION=$(node -p "require('./package.json').version") | |
| ALPHA_VERSION="${CURRENT_VERSION}-alpha.${GITHUB_RUN_NUMBER}.${SHORT_SHA}" | |
| npm version $ALPHA_VERSION --no-git-tag-version | |
| npm run build | |
| npm publish --tag alpha --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| SHORT_SHA: ${{ steps.sha.outputs.short }} | |
| - name: Publish @leanmcp/auth (alpha) | |
| continue-on-error: true | |
| working-directory: packages/auth | |
| run: | | |
| CURRENT_VERSION=$(node -p "require('./package.json').version") | |
| ALPHA_VERSION="${CURRENT_VERSION}-alpha.${GITHUB_RUN_NUMBER}.${SHORT_SHA}" | |
| npm version $ALPHA_VERSION --no-git-tag-version | |
| npm run build | |
| npm publish --tag alpha --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| SHORT_SHA: ${{ steps.sha.outputs.short }} | |
| - name: Publish @leanmcp/core (alpha) | |
| continue-on-error: true | |
| working-directory: packages/core | |
| run: | | |
| CURRENT_VERSION=$(node -p "require('./package.json').version") | |
| ALPHA_VERSION="${CURRENT_VERSION}-alpha.${GITHUB_RUN_NUMBER}.${SHORT_SHA}" | |
| npm version $ALPHA_VERSION --no-git-tag-version | |
| npm run build | |
| npm publish --tag alpha --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| SHORT_SHA: ${{ steps.sha.outputs.short }} | |
| - name: Publish @leanmcp/ui (alpha) | |
| continue-on-error: true | |
| working-directory: packages/ui | |
| run: | | |
| CURRENT_VERSION=$(node -p "require('./package.json').version") | |
| ALPHA_VERSION="${CURRENT_VERSION}-alpha.${GITHUB_RUN_NUMBER}.${SHORT_SHA}" | |
| npm version $ALPHA_VERSION --no-git-tag-version | |
| npm run build | |
| npm publish --tag alpha --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| SHORT_SHA: ${{ steps.sha.outputs.short }} | |
| - name: Publish @leanmcp/cli (alpha) | |
| continue-on-error: true | |
| working-directory: packages/cli | |
| run: | | |
| CURRENT_VERSION=$(node -p "require('./package.json').version") | |
| ALPHA_VERSION="${CURRENT_VERSION}-alpha.${GITHUB_RUN_NUMBER}.${SHORT_SHA}" | |
| npm version $ALPHA_VERSION --no-git-tag-version | |
| npm run build | |
| npm publish --tag alpha --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| SHORT_SHA: ${{ steps.sha.outputs.short }} | |
| - name: Publish leanmcp (alpha) | |
| continue-on-error: true | |
| working-directory: packages/leanmcp | |
| run: | | |
| CURRENT_VERSION=$(node -p "require('./package.json').version") | |
| ALPHA_VERSION="${CURRENT_VERSION}-alpha.${GITHUB_RUN_NUMBER}.${SHORT_SHA}" | |
| npm version $ALPHA_VERSION --no-git-tag-version | |
| npm run build | |
| npm publish --tag alpha --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| SHORT_SHA: ${{ steps.sha.outputs.short }} | |
| call-e2e: | |
| needs: publish-alpha | |
| uses: ./.github/workflows/e2e-tests.yml | |
| secrets: inherit |