-
Notifications
You must be signed in to change notification settings - Fork 24
38 lines (30 loc) · 1.04 KB
/
npm-publish.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
name: Publish contracts package to NPM
on: workflow_dispatch
jobs:
publish-npm:
runs-on: ubuntu-latest
env:
NODE_AUTH_TOKEN: ${{secrets.IDENTITY_NPM_PUBLISH_TOKEN}}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci
- name: "Clean Hardhat"
run: "npx hardhat clean"
- name: "Compile Hardhat"
run: "npx hardhat compile"
- name: Delete build folder
working-directory: ./contracts
run: rm -rf build
- name: Create build folder
working-directory: ./contracts
run: mkdir -p build/contracts
- name: "Copy artifacts"
run: find artifacts/contracts -type f -name "*.json" ! -name "*dbg.json" ! -path "artifacts/contracts/test-helpers/*" -exec cp {} "contracts/build/contracts" \;
- name: publish contracts package to NPM
working-directory: ./contracts
run: npm publish