core: copy publish exports to dist package json (#134) #84
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: Prerelease | |
on: | |
push: | |
branches: [main] | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
prerelease: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
- name: Install | |
run: bun install --frozen-lockfile | |
# Use changeset's built-in JSON output to detect which packages have pending changes | |
- name: Check for changesets | |
id: changesets | |
run: | | |
# Generate JSON status of all pending changesets | |
if bun changeset status --output changeset-status.json 2>/dev/null; then | |
# Parse JSON using our dedicated script | |
bun .github/scripts/check-changesets.js changeset-status.json >> $GITHUB_OUTPUT | |
else | |
# changeset status failed - assume no changesets | |
echo "hasChangesets=false" >> $GITHUB_OUTPUT | |
echo "hasCoreChangesets=false" >> $GITHUB_OUTPUT | |
echo "hasCliChangesets=false" >> $GITHUB_OUTPUT | |
fi | |
# Generate canary versions for all packages that have changesets | |
# This step runs regardless of which packages changed since changeset handles it | |
- name: Version packages | |
if: steps.changesets.outputs.hasChangesets == 'true' | |
run: | | |
# Create snapshot versions with git hash suffix (e.g., 1.0.0-canary-abc123) | |
bun changeset version --snapshot canary-$(git rev-parse --short HEAD) | |
# Conditional publishing - only publish packages that actually have changes | |
# This prevents unnecessary publishes and keeps the packages independent | |
- name: Publish core package (mcp-lite) | |
if: steps.changesets.outputs.hasCoreChangesets == 'true' | |
run: | | |
cd packages/core && bun publish --tag canary | |
env: | |
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish CLI package (create-mcp-lite) | |
if: steps.changesets.outputs.hasCliChangesets == 'true' | |
run: | | |
cd packages/create-mcp-lite && bun publish --tag canary | |
env: | |
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }} |