chore: sync from internal #363
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: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| # OIDC for npm provenance | |
| id-token: write | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| release: | |
| name: Publish to npm | |
| runs-on: ubuntu-latest | |
| # Only run on the public mirror — never on the internal repo | |
| if: github.repository == 'phantom/phantom-connect-sdk' | |
| env: | |
| NPM_CONFIG_PROVENANCE: true | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Setup Node.js 20.x | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: 20.x | |
| cache: "yarn" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Ensure npm 11.5.1+ for trusted publishing | |
| run: npm install -g npm@^11.5.1 | |
| - name: Install Dependencies | |
| run: yarn install --immutable | |
| - name: Build | |
| run: yarn build | |
| - name: MCP server smoke test | |
| run: yarn workspace @phantom/mcp-server test:smoke | |
| env: | |
| PHANTOM_AUTH_BASE_URL: http://127.0.0.1:1 | |
| PHANTOM_API_BASE_URL: http://127.0.0.1:1 | |
| - name: Run Lint | |
| run: yarn lint | |
| - name: Run Tests | |
| run: yarn test | |
| env: | |
| ORGANIZATION_PRIVATE_KEY: ${{ secrets.ORGANIZATION_PRIVATE_KEY }} | |
| ORGANIZATION_ID: ${{ secrets.ORGANIZATION_ID }} | |
| APP_ID: ${{ secrets.APP_ID }} | |
| WALLET_API: ${{ secrets.WALLET_API }} | |
| SOLANA_RPC_URL: ${{ secrets.SOLANA_RPC_URL }} | |
| - name: Publish to npm | |
| id: changesets | |
| uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba | |
| with: | |
| publish: yarn release | |
| commitMode: git-cli | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Verify MCP package installs cleanly | |
| run: yarn workspace @phantom/mcp-server test:pack | |
| env: | |
| PHANTOM_AUTH_BASE_URL: http://127.0.0.1:1 | |
| PHANTOM_API_BASE_URL: http://127.0.0.1:1 |