Skip to content

Commit 963e8e2

Browse files
authored
Merge pull request #40 from felixfaisal/master
[CI] Release binaries workflow added
2 parents 17890b2 + b8e9a93 commit 963e8e2

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: release binaries
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Toolchain installation
18+
run: sh -c "rustup toolchain install nightly && rustup target add wasm32-unknown-unknown && cargo install wasm-pack"
19+
20+
- name: Build binaries
21+
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
27+
28+

release-binaries.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
mkdir wasm-filters
2+
for d in */ ; do
3+
cd "$d";
4+
cargo=$(ls | grep "Cargo.toml")
5+
if [ "$cargo" != "" ];then
6+
wasm-pack build --release
7+
cd pkg
8+
file=$(ls | grep "wasm$")
9+
if [ "$file" != "" ]; then
10+
cp "$file" ../../wasm-filters/"$file"
11+
fi
12+
cd ..
13+
else
14+
for k in */ ; do
15+
cd "$k"
16+
cargo=$(ls | grep "Cargo.toml")
17+
if [ "$cargo" != "" ];then
18+
wasm-pack build --release
19+
cd pkg
20+
file=$(ls | grep "wasm$")
21+
if [ "$file" != "" ]; then
22+
cp "$file" ../../../wasm-filters/"$file"
23+
fi
24+
cd ..
25+
fi
26+
cd ..
27+
done
28+
fi
29+
cd ..
30+
done
31+
cd wasm-filters
32+
tar -czvf wasm-filters.tar.gz ./wasm-filters
33+
34+

0 commit comments

Comments
 (0)