Skip to content

Commit 37eb2a0

Browse files
committed
Build and upload wasm binaries to latest release
Signed-off-by: ashish <[email protected]>
1 parent 78c93b1 commit 37eb2a0

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed
Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,41 @@
1-
name: release binaries
1+
name: Build/Release binaries
22

33
on:
44
release:
55
types: [published]
6+
pull_request:
7+
branches:
8+
- "*"
9+
push:
10+
branches:
11+
- "*"
612

713
env:
814
CARGO_TERM_COLOR: always
915

1016
jobs:
1117
build:
12-
1318
runs-on: ubuntu-latest
14-
1519
steps:
1620
- uses: actions/checkout@v2
1721
- name: Toolchain installation
1822
run: sh -c "rustup toolchain install nightly && rustup target add wasm32-unknown-unknown && cargo install wasm-pack"
1923

2024
- name: Build binaries
2125
run: sh release-binaries.sh
22-
23-
- uses: actions/upload-artifact@v2
24-
with:
25-
name: wasm-filters.tar.gz
26-
path: ./wasm-filters.tar.gz
26+
27+
# the below step will take place only when there is a release
28+
- name: Upload wasm binaries to the latest made release
29+
if: github.event_name == 'release'
30+
run: |
31+
set -x
32+
assets=()
33+
for asset in ./wasm-filters/*.wasm; do
34+
assets+=("-a" "$asset")
35+
done
36+
tag_name="${GITHUB_REF##*/}"
37+
hub release edit "${assets[@]}" -m "" "$tag_name"
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2740

2841

release-binaries.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ for d in */ ; do
2828
fi
2929
cd ..
3030
done
31-
cd wasm-filters
32-
tar -czvf wasm-filters.tar.gz ./wasm-filters
31+
3332

3433

0 commit comments

Comments
 (0)