Skip to content

Commit

Permalink
Build and upload wasm binaries to latest release
Browse files Browse the repository at this point in the history
Signed-off-by: ashish <[email protected]>
  • Loading branch information
Revolyssup committed Feb 25, 2022
1 parent 78c93b1 commit 37eb2a0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
name: release binaries
name: Build/Release binaries

on:
release:
types: [published]
pull_request:
branches:
- "*"
push:
branches:
- "*"

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Toolchain installation
run: sh -c "rustup toolchain install nightly && rustup target add wasm32-unknown-unknown && cargo install wasm-pack"

- name: Build binaries
run: sh release-binaries.sh

- uses: actions/upload-artifact@v2
with:
name: wasm-filters.tar.gz
path: ./wasm-filters.tar.gz

# the below step will take place only when there is a release
- name: Upload wasm binaries to the latest made release
if: github.event_name == 'release'
run: |
set -x
assets=()
for asset in ./wasm-filters/*.wasm; do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release edit "${assets[@]}" -m "" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


3 changes: 1 addition & 2 deletions release-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ for d in */ ; do
fi
cd ..
done
cd wasm-filters
tar -czvf wasm-filters.tar.gz ./wasm-filters



0 comments on commit 37eb2a0

Please sign in to comment.