Skip to content

Commit

Permalink
Merge pull request #47 from Revolyssup/upload
Browse files Browse the repository at this point in the history
Build and upload wasm binaries to latest release
  • Loading branch information
leecalcote authored Feb 25, 2022
2 parents 78c93b1 + 58bdd3f commit 9fd99f6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
36 changes: 23 additions & 13 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
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 "" "stable-$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 9fd99f6

Please sign in to comment.