diff --git a/.github/actions/wasm-pack/Dockerfile.wasm-build b/.github/actions/wasm-pack/Dockerfile.wasm-build new file mode 100644 index 000000000..2af8fe869 --- /dev/null +++ b/.github/actions/wasm-pack/Dockerfile.wasm-build @@ -0,0 +1,5 @@ +FROM rust:slim + +ADD ./entry_point.sh entry_point.sh + +CMD [ "/entry_point.sh" ] \ No newline at end of file diff --git a/.github/actions/wasm-pack/action.yml b/.github/actions/wasm-pack/action.yml new file mode 100644 index 000000000..f815452c7 --- /dev/null +++ b/.github/actions/wasm-pack/action.yml @@ -0,0 +1,6 @@ +# action.yml +name: 'Build Wasm-Pack' + +runs: + using: 'docker' + image: 'Dockerfile.wasm-build' diff --git a/.github/actions/wasm-pack/entry_point.sh b/.github/actions/wasm-pack/entry_point.sh new file mode 100644 index 000000000..d6059c686 --- /dev/null +++ b/.github/actions/wasm-pack/entry_point.sh @@ -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 \ No newline at end of file diff --git a/.github/workflows/wasm-pack-build.yml b/.github/workflows/wasm-pack-build.yml new file mode 100644 index 000000000..27318d8a5 --- /dev/null +++ b/.github/workflows/wasm-pack-build.yml @@ -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/github-action-push-to-another-repository@v1.7.2 + 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"