Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/abi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: DeFi
on:
push:
tags:
- v*

concurrency:
cancel-in-progress: true
group: ${{ github.ref_name }}

jobs:
abi-gen:
name: "Generate and publish ABI"
runs-on: ubuntu-latest
environment: master
steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: "yarn"
cache-dependency-path: contracts/yarn.lock

- run: yarn install --frozen-lockfile
working-directory: ./contracts

- name: "Generate ABI files"
run: (yarn run abi:generate) && (yarn run abi:dist)
env:
CONTRACT_SIZE: true
working-directory: ./contracts

- name: Update version from tag
working-directory: ./contracts/dist
run: |
VERSION="0.1.0"
if [ "${{ env.GITHUB_REF_TYPE }}" = "tag" ]; then
VERSION="${GITHUB_REF_NAME#v}"
fi

echo "Version set to $VERSION"
sed -i -e "s/RELEASE_VERSION/$VERSION/g" package.json

- name: "Publish"
run: npm publish --access public
working-directory: ./contracts/dist
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ORIGIN_DEFI }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ contracts/deployments/hardhat*
contracts/coverage/
contracts/coverage.json
contracts/build/
contracts/dist/
dapp/network.json
dapp/keys/
dapp/ganache-network.json
Expand Down
3 changes: 3 additions & 0 deletions contracts/.npmrc.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
registry=https://registry.npmjs.org/
always-auth=true
9 changes: 9 additions & 0 deletions contracts/abi.package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@origin/defi",
"version": "RELEASE_VERSION",
"license": "MIT",
"homepage": "https://github.com/originprotocol/origin-dollar",
"engines": {
"node": "16"
}
}
2 changes: 2 additions & 0 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"deploy:mainnet": "(npx hardhat deploy --network mainnet --verbose --export '../dapp/network.mainnet.json') && yarn run copy-interface-artifacts",
"deploy:oeth": "(rm -rf deployments/hardhat && npx hardhat deploy --export '../dapp-oeth/network.json') && yarn run copy-interface-artifacts:oeth",
"deploy:oeth:mainnet": "(npx hardhat deploy --network mainnet --verbose --export '../dapp-oeth/network.mainnet.json') && yarn run copy-interface-artifacts",
"abi:generate": "(rm -rf deployments/hardhat && mkdir -p dist/abi && npx hardhat deploy --export '../dist/network.json')",
"abi:dist": "find ./artifacts/contracts -name \"*.json\" -type f -exec cp {} ./dist/abi \\; && rm -rf dist/abi/*.dbg.json dist/abi/Mock*.json && cp ./abi.package.json dist/package.json && cp ./.npmrc.abi dist/.npmrc",
"node": "yarn run node:fork",
"node:fork": "./node.sh fork",
"lint": "yarn run lint:js && yarn run lint:sol",
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"build:oethdapp": "(cd dapp-oeth && NODE_ENV=development yarn install && yarn build)",
"start": "bash devops/start-dapp.sh"
},
"dependencies": {
"react-use": "^17.4.0"
},
"engines": {
"node": "16"
}
Expand Down