Files
breez-sdk-liquid/.github/workflows/publish-wasm.yml
Ross Savage 7a9aa02cf7 Wasm publish (#815)
* Add Wasm CI publishing

* Add Deno dummy

* Add missing mkdir for deno

* Don't build dummies as we need the javascript interaces generating
2025-04-03 08:36:28 +00:00

74 lines
2.1 KiB
YAML

name: Publish Wasm Package
on:
workflow_call:
inputs:
repository:
description: 'sdk repository, defaults to current repository'
required: false
type: string
ref:
description: 'commit/tag/branch reference'
required: true
type: string
package-version:
description: 'version for the npm package (MAJOR.MINOR.BUILD)'
required: true
type: string
publish:
description: 'value indicating whether to publish to npm.'
required: true
type: boolean
default: false
secrets:
NPM_TOKEN:
description: 'access token for npm publish'
required: true
jobs:
build-package:
runs-on: ubuntu-latest
steps:
- name: Checkout breez-sdk-liquid repo
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository || github.repository }}
ref: ${{ inputs.ref || github.sha }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
scope: '@breeztech'
- name: Download wasm bindings
uses: actions/download-artifact@v4
with:
name: bindings-wasm
path: packages/wasm
- name: Remove unpublished files
working-directory: packages/wasm
run: rm -rf examples makefile DEVELOPMENT.md PUBLISHING.md
- name: Make sure we publish the version as specified
working-directory: packages/wasm
run: npm --no-git-tag-version --allow-same-version version ${{ inputs.package-version || '0.0.2' }}
- name: Pack for archival
working-directory: packages/wasm
run: yarn pack --filename breez-sdk-liquid.tgz
- name: Archive the package
uses: actions/upload-artifact@v4
with:
name: wasm-${{ inputs.package-version || '0.0.2' }}
path: packages/wasm/breez-sdk-liquid.tgz
- name: Publish package to npm
if: ${{ inputs.publish }}
working-directory: packages/wasm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn publish