forked from ourzora/v3
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (61 loc) · 2.54 KB
/
deploy-core.yml
File metadata and controls
63 lines (61 loc) · 2.54 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Deploy Core
on:
workflow_dispatch:
inputs:
environment:
description: "Name of github environment, i.e. rinkeby. Environment can be named anything as long as it includes the following vars: NPM_TOKEN, ETHERSCAN_API_KEY, RPC_URL, PRIVATE_KEY, WALLET_ADDRESS, REGISTRAR, FEE_SETTINGS_OWNER."
required: true
chainid:
description: "Chain id for corresponding environment. This can't be an environment variable due to an annoying technicality."
required: true
overwrite:
description: 'Optional. Enter "overwrite" to deploy even if core contracts already have addresses in addresses/<chain-id>.json file.'
jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-node@v2
with:
node-version: "16"
- run: npm install && npm install --global yarn
- name: Install Foundry
uses: onbjerg/foundry-toolchain@v1
with:
version: nightly
- name: Build
run: forge build
- name: Run deploy script
run: bash ./deploy/deploy-core.sh ${{ github.event.inputs.overwrite }}
- name: Bump version
run: npm i -g json-bump && json-bump package.json && yarn prettier --write package.json && npm i -g json && echo "TAG=v$(cat package.json | json version)" >> $GITHUB_ENV
- name: Push new addresses and package.json
uses: EndBug/add-and-commit@v9
with:
add: '["addresses/${{ github.event.inputs.chainid }}.json", "package.json"]'
message: "Commit from Github Actions (deploy core)"
new_branch: main
pathspec_error_handling: ignore
tag: ${{ env.TAG }}
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
dry-run: false
- name: Bundle release
run: sudo apt-get install zip && zip -r ${{ env.TAG }}.zip dist package.json LICENSE README.md
- uses: ncipollo/release-action@v1
with:
artifacts: ${{ env.TAG }}.zip
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.TAG }}
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
CHAIN_ID: ${{ github.event.inputs.chainid }}
RPC_URL: ${{ secrets.RPC_URL }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
WALLET_ADDRESS: ${{ secrets.WALLET_ADDRESS }}
REGISTRAR: ${{ secrets.REGISTRAR }}
FEE_SETTINGS_OWNER: ${{ secrets.FEE_SETTINGS_OWNER }}