Skip to content

chore: sync from internal #371

chore: sync from internal

chore: sync from internal #371

Workflow file for this run

# owner: wp
# slack: #wallet-platform
name: Release
on:
push:
branches:
- main
permissions: {}
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'
environment: ci
permissions:
contents: write
pull-requests: write
# OIDC for npm provenance
id-token: write
actions: write
env:
NPM_CONFIG_PROVENANCE: true
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
# changesets publish uses commitMode: git-cli; credentials must persist for push (zizmor artipacked: explicit opt-in).
persist-credentials: true
# Self-hosted / locked-down images may not allow symlinks under /usr/bin (default corepack enable).
- name: Enable Corepack
run: |
COREPACK_BIN="${RUNNER_TEMP}/corepack-bin"
mkdir -p "${COREPACK_BIN}"
corepack enable yarn --install-directory "${COREPACK_BIN}"
echo "${COREPACK_BIN}" >> "${GITHUB_PATH}"
- 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