mirror of
https://github.com/aljazceru/bitcoin-waila.git
synced 2025-12-17 04:54:18 +01:00
75 lines
1.9 KiB
YAML
75 lines
1.9 KiB
YAML
name: Publish Package to crates.io and npmjs
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
jobs:
|
|
crates:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: nightly
|
|
components: clippy
|
|
override: true
|
|
profile: minimal
|
|
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: cargo-${{ runner.os }}-release-${{ hashFiles('**/Cargo.toml') }}
|
|
restore-keys: |
|
|
cargo-${{ runner.os }}-release-
|
|
cargo-${{ runner.os }}-
|
|
|
|
- name: Cargo Publish
|
|
run: cargo publish -p bitcoin-waila
|
|
env:
|
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
|
|
|
|
npm:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '16.x'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: cargo-${{ runner.os }}-release-${{ hashFiles('**/Cargo.toml') }}
|
|
restore-keys: |
|
|
cargo-${{ runner.os }}-release-
|
|
cargo-${{ runner.os }}-
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: nightly
|
|
components: clippy
|
|
target: wasm32-unknown-unknown
|
|
override: true
|
|
profile: minimal
|
|
|
|
- uses: jetli/wasm-pack-action@v0.4.0
|
|
with:
|
|
version: 'latest'
|
|
|
|
- name: Build wasm
|
|
run: wasm-pack build ./waila-wasm --release --target web --scope mutinywallet
|
|
|
|
- name: Publish wasm
|
|
run: wasm-pack publish --access public -t web
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|