Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch WasmerJS over to NPM workspaces #404

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/release-please/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"release-type": "node",
"packages": {
".": {
"package-name": "wasmer-sdk",
"exclude-paths": [
"examples/"
]
"packages/sdk": {
"package-name": "wasmer-sdk"
}
},
"bump-minor-pre-major": true,
Expand Down
2 changes: 1 addition & 1 deletion .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.6.0"
"packages/sdk": "0.6.0"
}
61 changes: 9 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,58 +35,17 @@ jobs:
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install JS Dependencies
run: npm ci
run: npm ci --workspaces
- name: Type Checking
run: cargo check --workspace --verbose --locked
working-directory: packages/sdk
- name: Unit Tests
run: wasm-pack test --headless --firefox
working-directory: packages/sdk
- name: Build Package
run: npm run build
run: npm run build --workspaces --if-present
- name: Integration Tests
run: npm run test

examples:
name: Build Examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Setup Rust
uses: dsherret/rust-toolchain-file@v1
- name: Install wasm-pack
uses: taiki-e/install-action@wasm-pack
- name: Install wasm-strip and wasm-opt
run: sudo apt-get update && sudo apt-get install -y wabt binaryen
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install JS Dependencies
run: npm ci
- name: Build Package
run: npm run build
- name: Build the wasmer.sh Example
run: |
npm ci
npm run build
working-directory: "examples/wasmer.sh"
- name: Build the Markdown Editor Example
run: |
npm ci
npm run build
working-directory: "examples/markdown-editor"
- name: Build the (Improved) Markdown Editor Example
run: |
npm ci
npm run build
working-directory: "examples/markdown-editor-improved"
- name: Build the ffmpeg demo
run: |
npm ci
npm run build
working-directory: "examples/ffmpeg-react"
run: npm run test --workspaces --if-present

api-docs:
name: API Docs
Expand All @@ -106,17 +65,17 @@ jobs:
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install JS Dependencies
run: npm ci
run: npm ci --workspaces
- name: Build
run: npm run build
run: npm run build:dev --workspace=@wasmer/sdk
- name: Generate Docs
run: npm run docs
run: npm run docs --workspace=@wasmer/sdk
- name: Upload API Docs
uses: JamesIves/[email protected]
if: github.ref == 'refs/heads/main'
with:
branch: gh-pages
folder: docs/public
folder: packages/sdk/docs/public
single-commit: true

lints:
Expand All @@ -138,15 +97,13 @@ jobs:
runs-on: ubuntu-latest
needs:
- check
- examples
steps:
- name: Time Reporter
uses: Michael-F-Bryan/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
jobs: |
Compile and Test
Build Examples
message: |
Make sure you keep an eye on build times!

Expand Down
26 changes: 7 additions & 19 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ jobs:
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install JS Dependencies
run: npm ci
run: npm ci --workspaces
- name: Build Packages
run: npm run build
run: npm run build --package=@wasmer/sdk
# Release Please has already incremented versions and published tags, so
# we just need to publish to NPM
- name: Publish to NPM
run: npm publish --access=public
run: npm publish --access=public --package=@wasmer/sdk
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand All @@ -89,31 +89,19 @@ jobs:
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install @wasmer/sdk Dependencies
run: npm ci
- name: Build @wasmer/sdk
run: npm run build
run: npm ci --workspaces
- name: Build JavaScript
run: npm run build --workspaces --if-present
- name: Generate API Docs
run: npm run docs
run: npm run docs --workspace=@wasmer/sdk
- name: Deploy API Docs to wasmer.io
run: wasmer deploy --registry="https://registry.wasmer.io/graphql" --token=${{ secrets.WASMER_CIUSER_PROD_TOKEN }} --non-interactive --no-wait --no-persist-id --publish-package --owner=wasmer-examples
continue-on-error: true
working-directory: docs
- name: Install wasmer.sh dependencies
run: npm ci
working-directory: examples/wasmer.sh
- name: Build wasmer.sh
run: npm run build
working-directory: examples/wasmer.sh
- name: Deploy wasmer.sh to wasmer.io
run: wasmer deploy --registry="https://registry.wasmer.io/graphql" --token=${{ secrets.WASMER_CIUSER_PROD_TOKEN }} --non-interactive --no-wait --no-persist-id --publish-package --owner=wasmer-examples
continue-on-error: true
working-directory: examples/wasmer.sh
- name: Install ffmpeg-react dependencies
run: npm ci
working-directory: examples/ffmpeg-react
- name: Build ffmpeg-react
run: npm run build
working-directory: examples/ffmpeg-react
- name: Deploy ffmpeg-react to wasmer.io
run: wasmer deploy --registry="https://registry.wasmer.io/graphql" --token=${{ secrets.WASMER_CIUSER_PROD_TOKEN }} --non-interactive --no-wait --no-persist-id --publish-package --owner=wasmer-examples
continue-on-error: true
Expand Down
Loading
Loading