Publish contracts package to NPM #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |