Skip to content

Commit 7135c49

Browse files
authored
Create wasm_release.yml
1 parent 0bf6443 commit 7135c49

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/wasm_release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: WASM Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
packages: write
9+
10+
jobs:
11+
release:
12+
name: WASM Release and Publish
13+
runs-on: ubuntu-latest
14+
15+
# Restrict execution to specific users
16+
if: github.ref == 'refs/heads/master' && contains(["mtbitcr", "zupzup", "tompro"], github.actor)
17+
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Extract version from Cargo.toml
26+
id: get_version
27+
run: |
28+
VERSION=$(grep -m 1 '^version =' crates/bcr-ebill-pwa/Cargo.toml | cut -d '"' -f2)
29+
echo "VERSION=$VERSION" >> $GITHUB_ENV
30+
echo "Detected version: v$VERSION"
31+
32+
- name: Ensure tag does not already exist
33+
run: |
34+
if git rev-parse "v${{ env.VERSION }}" >/dev/null 2>&1; then
35+
echo "Error: Tag v${{ env.VERSION }} already exists!"
36+
exit 1
37+
fi
38+
39+
- name: Install wasm-pack
40+
run: |
41+
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

0 commit comments

Comments
 (0)