chore: sync from internal #340
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@v4 | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Setup Node.js 20.x | |
| uses: actions/setup-node@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: 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 }} |