Skip to content

Commit

Permalink
trying again
Browse files Browse the repository at this point in the history
  • Loading branch information
maebli committed Jun 13, 2024
1 parent 4b9e1d5 commit 86f1ead
Showing 1 changed file with 41 additions and 31 deletions.
72 changes: 41 additions & 31 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,34 +123,44 @@ jobs:
cd cli/src
cargo publish --token ${{ secrets.CRATESTOKEN }}
publish-wasm:
needs: build-wasm
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/wasm-v')
steps:
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Install wasm-pack
run: cargo install wasm-pack
- name: Build wasm package
run: |
cd wasm
wasm-pack build --target bundler
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
token: ${{ secrets.NPM_TOKEN }}
- name: Publish to npm
run: |
cd wasm/pkg
npm ci
npm publish
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Here are the steps to fix the publish-wasm GitHub Actions workflow:

Ensure the checkout step is done before any build or install steps.
The npm publish step is done twice; remove the duplicate.
Add a step to install npm dependencies before publishing.

Here is the corrected workflow:

yaml

publish-wasm:
needs: build-wasm
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/wasm-v')
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Install wasm-pack
run: cargo install wasm-pack
- name: Build wasm package
run: |
cd wasm
wasm-pack build --target bundler
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
token: ${{ secrets.NPM_TOKEN }}
- name: Install npm dependencies
run: |
cd wasm/pkg
npm ci
- name: Publish to npm
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 86f1ead

Please sign in to comment.