diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index a9ac665e61..0000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,14 +0,0 @@ -## Description - - - -## Deployed Contract - - - -Rinkeby contract address `ADDRESS_HERE` \ No newline at end of file diff --git a/.github/workflows/contract-deployment.yaml b/.github/workflows/contract-deployment.yaml new file mode 100644 index 0000000000..ea4434166b --- /dev/null +++ b/.github/workflows/contract-deployment.yaml @@ -0,0 +1,55 @@ +name: Contracts CD + +on: + release: + types: + - created + +jobs: + build_and_test: + name: Build and Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 14.x + uses: actions/setup-node@v1 + with: + node-version: 14.x + - run: yarn + - run: yarn build + - name: Run contract tests + run: | + cd packages/nouns-contracts + yarn test + build_and_deploy: + name: Build and Deploy + needs: build_and_test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 14.x + uses: actions/setup-node@v1 + with: + node-version: 14.x + - run: yarn + - run: yarn build + - name: Deploy contract to Rinkeby + env: + INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }} + MNEMONIC: ${{ secrets.MNEMONIC }} + run: | + cd packages/nouns-contracts + npx hardhat run --network rinkeby scripts/deploy-ci.ts + - name: Verify contract on Etherscan + env: + INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }} + ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} + run: | + cd packages/nouns-contracts + echo "Giving Etherscan time to index" + sleep 60 # This could be replaced by polling etherscan on that address, wait for non-404 + npx hardhat verify --network rinkeby `cat logs/deploy.json| jq -r '.contractAddress'` + - name: Look here for contract info + run: | + cd packages/nouns-contracts + echo "Contract deployed on Rinkeby to `cat logs/deploy.json| jq -r '.contractAddress'`" diff --git a/.github/workflows/contracts.yaml b/.github/workflows/contracts.yaml index 41ef50b2b8..e32567a3ce 100644 --- a/.github/workflows/contracts.yaml +++ b/.github/workflows/contracts.yaml @@ -24,35 +24,3 @@ jobs: run: | cd packages/nouns-contracts yarn test - build_and_deploy: - name: Build and Deploy - needs: build_and_test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js 14.x - uses: actions/setup-node@v1 - with: - node-version: 14.x - - run: yarn - - run: yarn build - - name: Deploy contract to Rinkeby - env: - INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }} - MNEMONIC: ${{ secrets.MNEMONIC }} - run: | - cd packages/nouns-contracts - npx hardhat run --network rinkeby scripts/deploy-ci.ts - - name: Verify contract on Etherscan - env: - INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }} - ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} - run: | - cd packages/nouns-contracts - echo "Giving Etherscan time to index" - sleep 60 # This could be replaced by polling etherscan on that address, wait for non-404 - npx hardhat verify --network rinkeby `cat logs/deploy.json| jq -r '.contractAddress'` - - name: Look here for contract info - run: | - cd packages/nouns-contracts - echo "Contract deployed on Rinkeby to `cat logs/deploy.json| jq -r '.contractAddress'`"