-
Notifications
You must be signed in to change notification settings - Fork 36
64 lines (56 loc) · 1.96 KB
/
npm-contracts.yml
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
64
name: NPM TBTCv2 Contracts
on:
push:
branches:
- main
paths:
- "solidity/contracts/**"
- "solidity/deploy/**"
- "solidity/tasks/**"
- "solidity/hardhat.config.ts"
- "solidity/package.json"
- "solidity/yarn.lock"
workflow_dispatch:
jobs:
npm-compile-publish-contracts:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./solidity
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "14.x"
registry-url: "https://registry.npmjs.org"
cache: "yarn"
cache-dependency-path: solidity/yarn.lock
# We need this step because the `@keep-network/tbtc` which we update in
# next steps has a dependency to `@summa-tx/relay-sol@2.0.2` package, which
# downloads one of its sub-dependencies via unathenticated `git://`
# protocol. That protocol is no longer supported. Thanks to this step
# `https://` is used instead of `git://`.
- name: Configure git to don't use unauthenticated protocol
run: git config --global url."https://".insteadOf git://
- name: Resolve latest contracts
run: |
yarn upgrade --exact \
@keep-network/ecdsa \
@keep-network/random-beacon \
@keep-network/tbtc
# Deploy contracts to a local network to generate deployment artifacts that
# are required by dashboard compilation.
- name: Deploy contracts
run: yarn deploy:test --network hardhat --write true
- name: Bump up package version
id: npm-version-bump
uses: keep-network/npm-version-bump@v2
with:
work-dir: ./solidity
environment: dev
branch: ${{ github.ref }}
commit: ${{ github.sha }}
- name: Publish package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access=public --tag=development --network=hardhat