Skip to content

Publish contracts package to NPM #47

Publish contracts package to NPM

Publish contracts package to NPM #47

Workflow file for this run

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: 20
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