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

wasm: Add action for wasm builds #524

Closed
wants to merge 4 commits into from
Closed
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
5 changes: 5 additions & 0 deletions .github/actions/wasm-pack/Dockerfile.wasm-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM rust:slim

ADD ./entry_point.sh entry_point.sh

CMD [ "/entry_point.sh" ]
6 changes: 6 additions & 0 deletions .github/actions/wasm-pack/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# action.yml
name: 'Build Wasm-Pack'

runs:
using: 'docker'
image: 'Dockerfile.wasm-build'
8 changes: 8 additions & 0 deletions .github/actions/wasm-pack/entry_point.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh -l
# Build the wasm pack
PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
echo "Starting wasm action"
cargo install wasm-pack
cd $GITHUB_WORKSPACE/extensions/warp-ipfs
echo "Building wasm-pack"
wasm-pack build --target web
28 changes: 28 additions & 0 deletions .github/workflows/wasm-pack-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Wasm-Pack build
on:
push:
paths:
- 'extensions/warp-ipfs/**'
pull_request:
paths:
- 'extensions/warp-ipfs/**'

jobs:
push_wasm_pack:
runs-on: ubuntu-latest
name: Building and publishing Wasm-Pack
steps:
- uses: actions/checkout@v4
- name: Build wasm-pack
id: wasm-pack
uses: ./.github/actions/wasm-pack
- name: Push Remote
uses: cpina/[email protected]
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
with:
source-directory: 'extensions/warp-ipfs/pkg'
destination-github-username: 'Satellite-im'
destination-repository-name: 'Warp'
# user-email: ""
target-directory: "pkg"