-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (47 loc) · 1.56 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: release-please
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: rust
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo fmt --all -- --check
if: ${{ steps.release.outputs.release_created }}
- run: cargo install wasm-pack
if: ${{ steps.release.outputs.release_created }}
- run: wasm-pack pack
if: ${{ steps.release.outputs.release_created }}
- name: Update Package Name
if: ${{ steps.release.outputs.release_created }}
run: |
new_name="@scuderia-fe/docx-to-html"
if [ -d "pkg" ]; then
cd pkg || exit
if [ -f "package.json" ]; then
# Update the "name" field in package.json
sed -i "s/\"name\": \".*\",/\"name\": \"$new_name\",/" package.json
echo "Package name updated to $new_name"
else
echo "Error: package.json not found in the pkg folder."
fi
cd ..
else
echo "Error: pkg folder not found."
fi
- run: wasm-pack publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}