mirror of
https://github.com/blyssprivacy/sdk.git
synced 2026-01-13 00:58:06 -05:00
* bucket check and async setup clients perform direct setup by default * (python) more consistent json for internal api all requests and response are JSON. all binary payloads are explicitly encoded as base64 within api.py, and decoded back to bytes before leaving api.py. User-facing code, e.g. bucket.py and bucket_service.py, should not see base64 wrangling. * Support async for all ops refactor api.py to be async-first use new asyncio loops to support non-async interface; cannot call non-async methods from async context * [js] update client to work with unified service bump both versions to 0.2.1 disable npm/pypi publish except on manual workflow run * disable request compression * fix workflow tests update standalone Spiral test server to use new JSON interface
96 lines
2.1 KiB
YAML
96 lines
2.1 KiB
YAML
name: Build JavaScript SDK
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
- 'examples/**'
|
|
- '**.md'
|
|
- 'python/**'
|
|
workflow_dispatch:
|
|
inputs:
|
|
publish:
|
|
description: 'Should packages be published to npm?'
|
|
required: true
|
|
default: false
|
|
type: boolean
|
|
|
|
jobs:
|
|
client-build:
|
|
name: Build SDK
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 'lts/*'
|
|
|
|
- name: Install wasm-pack
|
|
uses: jetli/wasm-pack-action@f98777369a49686b132a9e8f0fdd59837bf3c3fd
|
|
with:
|
|
version: v0.10.3
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
npm ci
|
|
|
|
- name: Run build
|
|
run: |
|
|
npm run build
|
|
|
|
- name: Run tests
|
|
run: |
|
|
npm test
|
|
|
|
- name: Run end-to-end tests
|
|
run: |
|
|
npm run e2e-tests
|
|
|
|
- name: Upload single-file bundle
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: sdk-bundle
|
|
path: dist/blyss-bundle.min.js
|
|
|
|
- name: Upload complete bundle
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: sdk
|
|
path: dist/
|
|
|
|
# TODO: dedupe build steps from publish
|
|
client-publish:
|
|
name: Publish JavaScript SDK
|
|
runs-on: ubuntu-latest
|
|
if: ${{ inputs.publish }}
|
|
needs: [client-build]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '19.x'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- name: Install wasm-pack
|
|
uses: jetli/wasm-pack-action@f98777369a49686b132a9e8f0fdd59837bf3c3fd
|
|
with:
|
|
version: v0.10.3
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
npm ci
|
|
|
|
- name: Run build
|
|
run: |
|
|
npm run build
|
|
|
|
- name: Publish to NPM
|
|
run: npm publish
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|