Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 32 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ jobs:
uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: "18.18.0"
- name: Setup yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install
- name: Compile
run: yarn && yarn build
run: yarn build

test:
runs-on: ubuntu-latest
Expand All @@ -24,8 +30,14 @@ jobs:
uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v4
- name: Compile & Test
run: yarn && yarn test
with:
node-version: "18.18.0"
- name: Setup yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install
- name: Run tests
run: yarn test

run-examples:
name: Run examples (to look for regressions)
Expand All @@ -36,9 +48,13 @@ jobs:
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: 21
node-version: "21"
- name: Setup yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install
- name: Build
run: yarn && yarn build
run: yarn build
- name: test examples
run: |
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
Expand All @@ -52,21 +68,27 @@ jobs:
node examples/trade-search.mjs

publish:
needs: [ compile, test, run-examples ]
needs: [compile, test, run-examples]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: "18.18.0"
- name: Setup yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Publish to npm
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
npm publish --access public
env:
NPM_TOKEN: ${{ secrets.SDK_NPM_TOKEN }}
publish() {
npx -y npm@latest publish "$@"
}
publish --access public