Skip to content

Commit

Permalink
v2.9.5: feat() use github action for test, feat() publish with proven…
Browse files Browse the repository at this point in the history
…ance, fix(#398) bestBid/bestAskPrice property in 24hr ticker formatted type
  • Loading branch information
tiagosiebler committed Feb 13, 2024
1 parent b716de2 commit 614721d
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 28 deletions.
51 changes: 25 additions & 26 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,26 @@ on:
branches:
- master

permissions:
id-token: 'write'
contents: 'read'

jobs:
build:
name: 'Publish NPM'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: 'Checkout source code'
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 12
# - run: npm ci
# - run: npm test
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org/'
cache: 'npm'

publish-npm:
needs: build
name: 'Publish NPM'
runs-on: ubuntu-latest
steps:
- name: Package Version Updated
Expand All @@ -31,36 +38,28 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v2
- name: 'Checkout source code'
if: steps.version-updated.outputs.has-updated
uses: actions/checkout@v4

- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
if: steps.version-updated.outputs.has-updated
with:
node-version: 12
registry-url: https://registry.npmjs.org/
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org/'
cache: 'npm'

- run: npm ci --ignore-scripts
- name: Install
run: npm ci --ignore-scripts
if: steps.version-updated.outputs.has-updated

- run: npm run clean
if: steps.version-updated.outputs.has-updated

- run: npm run build
if: steps.version-updated.outputs.has-updated
- run: npm publish --ignore-scripts

- run: npm publish --ignore-scripts --provenance
if: steps.version-updated.outputs.has-updated
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

#publish-gpr:
#needs: build
#runs-on: ubuntu-latest
#steps:
#- uses: actions/checkout@v2
#- uses: actions/setup-node@v1
# with:
# node-version: 12
# registry-url: https://npm.pkg.github.com/
#- run: npm ci
#- run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Build & Test'

on: [push]

jobs:
build:
name: 'Build & Test'
runs-on: ubuntu-latest

steps:
- name: 'Checkout source code'
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org/'
cache: 'npm'

- name: Install
run: npm ci --ignore-scripts

- name: Build
run: npm run build

- name: Test
run: npm run test
env:
API_KEY_COM: ${{ secrets.API_KEY_COM }}
API_SECRET_COM: ${{ secrets.API_SECRET_COM }}
PROXY_ENABLED: ${{ secrets.PROXY_ENABLED }}
PROXY_HOST: ${{ secrets.PROXY_HOST }}
PROXY_PASS: ${{ secrets.PROXY_PASS }}
PROXY_PORT: ${{ secrets.PROXY_PORT }}
PROXY_USER: ${{ secrets.PROXY_USER }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "binance",
"version": "2.9.4",
"version": "2.9.5",
"description": "Node.js & JavaScript SDK for Binance REST APIs & WebSockets, with TypeScript & end-to-end tests.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/types/websockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ export interface WsMessage24hrTickerFormatted extends WsSharedBase {
closeQuantity: number;
bestBid: number;
bestBidQuantity: number;
bestAsk: number;
bestAskPrice: number;
bestAskQuantity: number;
open: number;
high: number;
Expand Down

0 comments on commit 614721d

Please sign in to comment.