Skip to content

Commit

Permalink
Prepare WASM bindings for release (#1176)
Browse files Browse the repository at this point in the history
* Update node version

* Update .gitignore

* Use yarn instead of NPM

* Add WASM bindings release workflow

* Update build process

* Update build command

* Add CHANGELOG

* Add empty line to
  • Loading branch information
rygine authored Oct 23, 2024
1 parent 854307a commit 9331eb7
Show file tree
Hide file tree
Showing 11 changed files with 1,262 additions and 325 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/release-wasm-bindings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release WASM Bindings

on:
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
release:
permissions:
id-token: write
runs-on: warp-ubuntu-latest-x64-16x
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Update rust toolchains, add target
run: |
rustup update
- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
bindings_wasm
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
cache-dependency-path: "bindings_wasm/yarn.lock"
cache: "yarn"
env:
SKIP_YARN_COREPACK_CHECK: "1"

- name: Enable corepack
run: corepack enable

- name: Install dependencies
working-directory: bindings_wasm
run: |
yarn
- name: Build
working-directory: bindings_wasm
run: yarn build

- name: Publish to NPM
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: bindings_wasm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions bindings_wasm/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
/target
/build

# yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# build artifacts
dist
2 changes: 1 addition & 1 deletion bindings_wasm/.node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.19.1
20.15.0
2 changes: 1 addition & 1 deletion bindings_wasm/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.19.1
20.15.0
934 changes: 934 additions & 0 deletions bindings_wasm/.yarn/releases/yarn-4.5.1.cjs

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions bindings_wasm/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.5.1.cjs
5 changes: 5 additions & 0 deletions bindings_wasm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# @xmtp/wasm-bindings

## 0.0.1

Initial release
292 changes: 0 additions & 292 deletions bindings_wasm/package-lock.json

This file was deleted.

Loading

0 comments on commit 9331eb7

Please sign in to comment.