Skip to content

Commit 35b5b92

Browse files
committed
init
1 parent 0bf6443 commit 35b5b92

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/wasm_release.yml

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

0 commit comments

Comments
 (0)