-
Notifications
You must be signed in to change notification settings - Fork 2
99 lines (86 loc) · 3.08 KB
/
manual-publish-npm.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
name: "Build and publish packages to npm"
on:
workflow_dispatch:
inputs:
package:
description: "Package to publish"
required: true
type: choice
options:
- shielder-sdk
- shielder-sdk-crypto
- shielder-sdk-crypto-wasm
tag:
description: "NPM tag"
required: true
type: choice
options:
- develop
- latest
jobs:
publish:
name: Build and push ${{ github.event.inputs.package }}
runs-on: [self-hosted, Linux, X64, medium]
steps:
- name: GIT | Checkout
uses: actions/checkout@v4
# Rust setup for shielder-sdk-crypto-wasm and shielder-sdk
- name: Prepare Rust env
if: |
github.event.inputs.package == 'shielder-sdk-crypto-wasm' ||
github.event.inputs.package == 'shielder-sdk'
uses: ./.github/actions/prepare-rust-env
with:
poseidon-gadget-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
zkos-circuits-private-key: ${{ secrets.ZKOS_CIRCUITS_SSH_PRIVATE_KEY }}
- name: Install wasm-pack
if: github.event.inputs.package == 'shielder-sdk-crypto-wasm'
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
# Foundry setup for shielder-sdk
- name: Install Foundry
if: github.event.inputs.package == 'shielder-sdk'
uses: foundry-rs/[email protected]
with:
cache-key: custom-seed-coverage-${{ github.ref_name }}
cache-restore-keys: |-
contract-suite
version: nightly-31dd1f77fd9156d09836486d97963cec7f555343
- name: Install deps and compile contracts
if: github.event.inputs.package == 'shielder-sdk'
run: |
make deps
make compile-contracts
# Common Node.js setup
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 23
- uses: pnpm/action-setup@v4
with:
version: latest
# Build steps
- name: Build shielder-wasm
if: github.event.inputs.package == 'shielder-sdk-crypto-wasm'
run: make all
working-directory: crates/shielder-wasm
- name: Install dependencies (workspace)
run: pnpm install-deps
working-directory: ts
- name: Build package
run: |
if [ "${{ github.event.inputs.package }}" = "shielder-sdk" ]; then
pnpm build-package:sdk
elif [ "${{ github.event.inputs.package }}" = "shielder-sdk-crypto" ]; then
pnpm build-package:crypto
else
pnpm build-package:crypto-wasm
fi
working-directory: ts
# Publish
- name: Add .npmrc with publish token
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISHING_KEY }}" > .npmrc
working-directory: ts/${{ github.event.inputs.package }}
- name: Publish package
run: pnpm publish --access restricted --no-git-checks --tag ${{ github.event.inputs.tag }}
working-directory: ts/${{ github.event.inputs.package }}