chore: link external tokenlist repo (#1024) #231
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: SDK NPM Publish | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| defaults: | |
| run: | |
| working-directory: ./sdk | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: setup node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'npm' | |
| cache-dependency-path: sdk/package-lock.json | |
| - name: install tokenlist dependencies | |
| working-directory: ./tokenlist | |
| run: npm ci | |
| - run: npm ci | |
| - run: npm run build | |
| - name: get sdk version | |
| id: version | |
| run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: check if version already published | |
| run: | | |
| if npm view @gobob/bob-sdk@${{ steps.version.outputs.version }} &>/dev/null; then | |
| echo "Version ${{ steps.version.outputs.version }} already published to npm, skipping publish" | |
| echo "PUBLISH=false" >> $GITHUB_ENV | |
| else | |
| echo "PUBLISH=true" >> $GITHUB_ENV | |
| fi | |
| - name: publish to npm | |
| if: env.PUBLISH == 'true' | |
| run: | | |
| if [[ "${{ steps.version.outputs.version }}" == *rc* ]]; then | |
| npm publish --access public --tag rc | |
| else | |
| npm publish --access public | |
| fi |