PilotSwarm 0.5.21 #76
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 npm Packages | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: npm dist-tag to publish under | |
| required: true | |
| default: latest | |
| dry_run: | |
| description: Run npm publish in dry-run mode | |
| required: false | |
| default: false | |
| type: boolean | |
| permissions: | |
| contents: read | |
| id-token: write | |
| env: | |
| NODE_VERSION: "24" | |
| NPM_DIST_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || 'latest' }} | |
| NPM_DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run || 'false' }} | |
| # Publish order: pilotswarm-sdk (self-contained; the wire client ships inside | |
| # it at pilotswarm-sdk/api) -> pilotswarm-horizon-store (peer-depends on sdk) | |
| # -> pilotswarm (the application package: TUI + portal/Web API + MCP bins; | |
| # depends on sdk from the registry). | |
| jobs: | |
| publish-sdk: | |
| name: Publish pilotswarm-sdk | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: https://registry.npmjs.org | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build workspaces | |
| run: npm run build | |
| - name: Publish SDK | |
| working-directory: packages/sdk | |
| run: | | |
| if [ "${NPM_DRY_RUN}" = "true" ]; then | |
| npm publish --access public --provenance --tag "${NPM_DIST_TAG}" --dry-run | |
| else | |
| npm publish --access public --provenance --tag "${NPM_DIST_TAG}" || { | |
| if npm view pilotswarm-sdk version 2>/dev/null | grep -q "$(node -p 'require("./package.json").version')"; then | |
| echo "Version already published — skipping" | |
| else | |
| exit 1 | |
| fi | |
| } | |
| fi | |
| publish-horizon-store: | |
| name: Publish pilotswarm-horizon-store | |
| runs-on: ubuntu-latest | |
| needs: publish-sdk | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: https://registry.npmjs.org | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build workspaces | |
| run: npm run build | |
| - name: Publish Horizon Store | |
| working-directory: packages/horizon-store | |
| run: | | |
| if [ "${NPM_DRY_RUN}" = "true" ]; then | |
| npm publish --access public --provenance --tag "${NPM_DIST_TAG}" --dry-run | |
| else | |
| npm publish --access public --provenance --tag "${NPM_DIST_TAG}" || { | |
| if npm view pilotswarm-horizon-store version 2>/dev/null | grep -q "$(node -p 'require("./package.json").version')"; then | |
| echo "Version already published — skipping" | |
| else | |
| exit 1 | |
| fi | |
| } | |
| fi | |
| publish-app: | |
| name: Publish pilotswarm | |
| runs-on: ubuntu-latest | |
| needs: [publish-sdk, publish-horizon-store] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: https://registry.npmjs.org | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build workspaces | |
| run: npm run build | |
| - name: Publish App | |
| working-directory: packages/app | |
| run: | | |
| if [ "${NPM_DRY_RUN}" = "true" ]; then | |
| npm publish --access public --provenance --tag "${NPM_DIST_TAG}" --dry-run | |
| else | |
| npm publish --access public --provenance --tag "${NPM_DIST_TAG}" || { | |
| if npm view pilotswarm version 2>/dev/null | grep -q "$(node -p 'require("./package.json").version')"; then | |
| echo "Version already published — skipping" | |
| else | |
| exit 1 | |
| fi | |
| } | |
| fi |