Publish TS SDK #11
This file contains 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 TS SDK | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version to publish' | |
required: true | |
type: 'string' | |
jobs: | |
publish-ts-sdk: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: "npm" | |
registry-url: "https://registry.npmjs.org" | |
- run: npm ci | |
- run: npm run version ${{ inputs.version }} | |
- run: npm run build --if-present | |
- run: npm test | |
- run: | | |
if [[ $VERSION == *"beta"* ]]; then | |
tag=beta | |
elif [[ $VERSION == *"alpha"* ]]; then | |
tag=alpha | |
else | |
tag=latest | |
fi | |
npm publish --access public --tag $tag \ | |
--workspace sdk/definitions \ | |
--workspace evm/ts \ | |
--workspace solana \ | |
--workspace sdk/route | |
env: | |
VERSION: ${{ inputs.version }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry |