Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

[hyperwasm] Make package public #61

[hyperwasm] Make package public

[hyperwasm] Make package public #61

Workflow file for this run

name: build wasm package
on:
pull_request:
branches:
- main
release:
types: [published]
jobs:
detect-changes:
uses: ./.github/workflows/check_diff.yml
with:
pattern: ^crates/hyperwasm/
build:
needs: detect-changes
# Run if changes are detected OR if triggered by a release
if: (needs.detect-changes.outputs.changed == 'true') || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/hyperwasm@v'))
name: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
token: ${{github.token}}
- name: setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install wasm-pack
run: cargo install wasm-pack
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
- name: setup foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: check out hyperdrive
uses: actions/checkout@master
with:
repository: delvtech/hyperdrive
ref: 'v0.2.0'
path: './hyperdrive'
ssh-key: ${{ secrets.HYPERDRIVE_ACCESS_KEY }}
- name: build hyperwasm
working-directory: crates/hyperwasm
run: sh build.sh
- name: publish hyperwasm
if: github.event_name == 'release'
working-directory: crates/hyperwasm/pkg
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}