Skip to content

Commit 9fd99f6

Browse files
authored
Merge pull request #47 from Revolyssup/upload
Build and upload wasm binaries to latest release
2 parents 78c93b1 + 58bdd3f commit 9fd99f6

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed
+23-13
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,38 @@
1-
name: release binaries
2-
1+
name: Build/Release binaries
32
on:
4-
release:
5-
types: [published]
3+
pull_request:
4+
branches:
5+
- "*"
6+
push:
7+
branches:
8+
- "*"
69

710
env:
811
CARGO_TERM_COLOR: always
912

1013
jobs:
1114
build:
12-
1315
runs-on: ubuntu-latest
14-
1516
steps:
1617
- uses: actions/checkout@v2
1718
- name: Toolchain installation
1819
run: sh -c "rustup toolchain install nightly && rustup target add wasm32-unknown-unknown && cargo install wasm-pack"
1920

2021
- name: Build binaries
2122
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-
23+
24+
# the below step will take place only when there is a release
25+
- name: Upload wasm binaries to the latest made release
26+
if: github.event_name == 'release'
27+
run: |
28+
set -x
29+
assets=()
30+
for asset in ./wasm-filters/*.wasm; do
31+
assets+=("-a" "$asset")
32+
done
33+
tag_name="${GITHUB_REF##*/}"
34+
hub release edit "${assets[@]}" -m "" "stable-$tag_name"
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
38+

release-binaries.sh

+1-2
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)