Skip to content

[BLY-64] Python Spiral v1, and docs #73

[BLY-64] Python Spiral v1, and docs

[BLY-64] Python Spiral v1, and docs #73

Workflow file for this run

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 || github.ref == 'refs/heads/main' }}
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 }}