Skip to content

Update Solana Unified Tokens List #207

Update Solana Unified Tokens List

Update Solana Unified Tokens List #207

name: Update Solana Unified Tokens List
on:
workflow_dispatch:
schedule:
# At 00:00 every day.
- cron: '0 0 * * *'
env:
TOKEN_LISTS_ACTIONS_OR_CI_BUILD: true
DAPP_RADAR_PROJECT_ID: ${{ secrets.DAPP_RADAR_PROJECT_ID }}
DAPP_RADAR_API_KEY: ${{ secrets.DAPP_RADAR_API_KEY }}
jobs:
generate:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Extract branch name
shell: bash
run: echo "GITHUB_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
id: extract_branch
- name: 'Configure git'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- run: brew install librsvg libimagequant pkg-config
- run: npm install -g yarn
- run: yarn
- run: yarn gen:solana
env:
SOLANA_MAINNET_RPC_URL: ${{ secrets.SOLANA_MAINNET_RPC_URL }}
TRUSTED_TOKEN_LIST_URL: https://cdn.jsdelivr.net/gh/brave/token-lists@${{ steps.extract_branch.outputs.GITHUB_BRANCH }}/data/solana/trusted-tokenlist.json
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update Solana UTL
file_pattern: 'data/solana/tokenlist.json'
- name: 'Bump patch version'
run: npm version patch
- run: yarn start
- run: git push
- run: npm run publish-token-package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}