-
-
Notifications
You must be signed in to change notification settings - Fork 111
60 lines (58 loc) · 1.88 KB
/
Copy pathpublish-wasm.yml
File metadata and controls
60 lines (58 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Publish WASM Packages
on:
push:
tags:
- 'buttplug-wasm-*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Fix ~/.cargo directory permissions
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
- name: Install required packages
run: sudo apt-get -y update && sudo apt-get -y install libudev-dev libusb-1.0-0-dev libdbus-1-dev
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Rust toolchain fetch
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: WASM Toolchain fetch
uses: jetli/wasm-pack-action@v0.4.0
with:
version: 'latest'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Build WASM crate
run: wasm-pack build crates/buttplug_wasm --target web
- name: Install workspace dependencies
run: cd wasm && npm install
- name: Build blob package
run: cd wasm && npm run build:blob
- name: Build connector package
run: cd wasm && npm run build:connector
- name: Publish buttplug-wasm-blob
run: cd wasm/packages/blob && npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish buttplug-wasm
run: cd wasm/packages/connector && npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}