Skip to content

Commit

Permalink
chore: fix wasm auto release and upgrade rust-cache in CI (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ma233 authored Jul 19, 2023
1 parent a991cc7 commit 2b7312b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 22 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ jobs:
rustup show
# If you need to reset the cache version, increment the number after `v`
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
with:
sharedKey: auto-release-${{ steps.target.outputs.target }}-v1
shared-key: auto-release-${{ steps.target.outputs.target }}-v1

- name: Build
run: |
Expand Down Expand Up @@ -132,9 +132,9 @@ jobs:
sudo apt-get install -y musl-tools
# If you need to reset the cache version, increment the number after `v`
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
with:
sharedKey: auto-release-${{ steps.target.outputs.target }}-v1
shared-key: auto-release-${{ steps.target.outputs.target }}-v1

- name: Build
run: |
Expand All @@ -148,8 +148,6 @@ jobs:
path: rings-${{ needs.gen_version.outputs.version }}-${{ steps.target.outputs.target }}.zip
retention-days: 1



build_browser:
needs: gen_version
name: build browser version binary
Expand Down Expand Up @@ -186,28 +184,26 @@ jobs:
rustup show
# If you need to reset the cache version, increment the number after `v`
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
with:
sharedKey: auto-release-${{ steps.target.outputs.target }}-v1
shared-key: auto-release-${{ steps.target.outputs.target }}-v1

- uses: actions/setup-node@v3
with:
node-version: 20

- name: Build
run: |
npm run prepare
npm pack
mv ringsnetwork-rings-node-*.tgz rings-${{ needs.gen_version.outputs.version }}-${{ steps.target.outputs.target }}.tgz
- uses: actions/upload-artifact@v3
name: Upload artifacts
with:
path: rings-${{ needs.gen_version.outputs.version }}-${{ steps.target.outputs.target }}
name: rings-${{ needs.gen_version.outputs.version }}-${{ steps.target.outputs.target }}.tgz
name: rings-${{ needs.gen_version.outputs.version }}-${{ steps.target.outputs.target }}
path: rings-${{ needs.gen_version.outputs.version }}-${{ steps.target.outputs.target }}.tgz
retention-days: 1


release:
needs: [gen_version, build_macos, build_linux, build_browser]
runs-on: ubuntu-latest
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/qaci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:
version: "0.2.84"

# If you need to reset the cache version, increment the number after `v`
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
with:
sharedKey: wasm-v1
shared-key: wasm-v1

- name: Run clippy for core wasm
run: cargo clippy -p rings-core --features wasm --no-deps --no-default-features --target=wasm32-unknown-unknown --tests -- -D warnings
Expand Down Expand Up @@ -71,9 +71,9 @@ jobs:
run: rustup show

# If you need to reset the cache version, increment the number after `v`
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
with:
sharedKey: default-v1
shared-key: default-v1

- name: Build
run: cargo build --all --verbose
Expand Down Expand Up @@ -101,9 +101,9 @@ jobs:
rustup show
# If you need to reset the cache version, increment the number after `v`
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
with:
sharedKey: static-v1
shared-key: static-v1

- name: Run clippy
run: cargo clippy --all --tests -- -D warnings
Expand Down
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ fmt:
clippy-fix:
cargo clippy --fix --allow-dirty --no-deps

build-browser-pack:
wasm-pack build node --scope ringsnetwork -t web --no-default-features --features browser --features console_error_panic_hook

test-core-wasm:
cd core; wasm-pack test --chrome --features browser_chrome_test --no-default-features

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"url": "https://github.com/RingsNetwork/rings-node"
},
"scripts": {
"prepare": "make build-browser-pack && cp node/pkg/rings_node* ./"
"wasm_pack": "wasm-pack build node --scope ringsnetwork -t web --no-default-features --features browser --features console_error_panic_hook",
"prepare": "npm run wasm_pack && cp node/pkg/rings_node* ./"
},
"files": [
"rings_node_bg.wasm",
Expand Down

0 comments on commit 2b7312b

Please sign in to comment.