Skip to content

Commit c4730ee

Browse files
Autopublish releases to npm (#91)
* initial test * . * test * add more steps * add step * prepublish step * remove test for now * add changes * add trigger * changes * fix test step * fix test step * fix branch naming * test publish step * rename step * test publish step again * rename * fix typo * try again * add prerequisite step * update node base image * update all node images * fix circleci * formatting * yarn * . * fix circleci * uncomment skipped sections * rc * regenerate yarn * config
1 parent 096a117 commit c4730ee

File tree

6 files changed

+2469
-62
lines changed

6 files changed

+2469
-62
lines changed

.circleci/config.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ version: 2
33
jobs:
44
checkout_and_compile:
55
docker:
6-
- image: circleci/node:10.16.0
7-
working_directory: ~/index-coop-private
6+
- image: cimg/node:lts
7+
working_directory: ~/index-coop-smart-contracts
88
steps:
99
- checkout
1010
- setup_remote_docker:
@@ -30,11 +30,11 @@ jobs:
3030
- save_cache:
3131
key: compiled-env-{{ .Environment.CIRCLE_SHA1 }}
3232
paths:
33-
- ~/index-coop-private
33+
- ~/index-coop-smart-contracts
3434
test:
3535
docker:
36-
- image: circleci/node:10.11.0
37-
working_directory: ~/index-coop-private
36+
- image: cimg/node:lts
37+
working_directory: ~/index-coop-smart-contracts
3838
parallelism: 2
3939
steps:
4040
- setup_remote_docker:
@@ -59,8 +59,8 @@ jobs:
5959
6060
test_forked_network:
6161
docker:
62-
- image: circleci/node:10.11.0
63-
working_directory: ~/index-coop-private
62+
- image: cimg/node:lts
63+
working_directory: ~/index-coop-smart-contracts
6464
steps:
6565
- setup_remote_docker:
6666
docker_layer_caching: false
@@ -82,8 +82,8 @@ jobs:
8282

8383
coverage:
8484
docker:
85-
- image: circleci/node:10.16.0
86-
working_directory: ~/index-coop-private
85+
- image: cimg/node:lts
86+
working_directory: ~/index-coop-smart-contracts
8787
parallelism: 2
8888
steps:
8989
- setup_remote_docker:
@@ -118,8 +118,8 @@ jobs:
118118

119119
coverage_forked_network:
120120
docker:
121-
- image: circleci/node:10.16.0
122-
working_directory: ~/index-coop-private
121+
- image: cimg/node:lts
122+
working_directory: ~/index-coop-smart-contracts
123123
steps:
124124
- setup_remote_docker:
125125
docker_layer_caching: false
@@ -150,8 +150,8 @@ jobs:
150150

151151
report_coverage:
152152
docker:
153-
- image: circleci/node:10.11.0
154-
working_directory: ~/index-coop-private
153+
- image: cimg/node:lts
154+
working_directory: ~/index-coop-smart-contracts
155155
steps:
156156
- attach_workspace:
157157
at: /tmp/coverage

.github/workflows/publish.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
11+
build-and-test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: copy env
16+
run: cp .env.default .env
17+
- name: install
18+
run: yarn
19+
- name: build
20+
run: yarn build
21+
- name: test
22+
run: |
23+
yarn chain &
24+
yarn test
25+
26+
publish:
27+
runs-on: ubuntu-latest
28+
if: ${{ github.ref == 'refs/heads/master' }}
29+
needs: [build]
30+
steps:
31+
- uses: actions/checkout@v2
32+
- name: copy env
33+
run: cp .env.default .env
34+
- name: install
35+
run: yarn
36+
- name: prepublish
37+
run: yarn prepublishOnly
38+
- name: release
39+
env:
40+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
42+
run: npx semantic-release --branches master

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@indexcoop:registry=https://registry.npmjs.org/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The distribution comes with fixtures for mocking and testing interactions with o
4848
including Uniswap and Compound. To use these you'll need to install the peer dependencies listed in `package.json`.
4949

5050
```
51-
npm install @setprotocol/index-coop-contracts
51+
npm install @indexcoop/index-coop-smart-contracts
5252
```
5353

5454
[22]: https://www.npmjs.com/package/hardhat
@@ -72,7 +72,7 @@ The disclosure of security vulnerabilities helps us ensure the security of our u
7272
**How to report a security vulnerability?**
7373

7474
If you believe you’ve found a security vulnerability in one of our contracts or platforms,
75-
send it to us by emailing [security@setprotocol.com](mailto:security@setprotocol.com).
75+
send it to us by emailing [security@indexcoop.com](mailto:security@indexcoop.com).
7676
Please include the following details with your report:
7777

7878
* A description of the location and potential impact of the vulnerability.

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@setprotocol/index-coop-contracts",
2+
"name": "@indexcoop/index-coop-smart-contracts",
33
"version": "0.0.29",
44
"description": "",
55
"main": "dist",
@@ -36,6 +36,7 @@
3636
"prepare": "yarn build",
3737
"prepublishOnly": "yarn clean && yarn build:npm",
3838
"rename-extensions": "for f in typechain/*.d.ts; do mv -- \"$f\" \"${f%.d.ts}.ts\"; done",
39+
"semantic-release": "semantic-release --branches master",
3940
"test": "npx hardhat test --network localhost",
4041
"test:fast": "TS_NODE_TRANSPILE_ONLY=1 npx hardhat test --network localhost --no-compile",
4142
"test:fast:compile": "TS_NODE_TRANSPILE_ONLY=1 npx hardhat test --network localhost",
@@ -50,11 +51,11 @@
5051
},
5152
"repository": {
5253
"type": "git",
53-
"url": "git+https://github.com/SetProtocol/index-coop-contracts.git"
54+
"url": "git+https://github.com/IndexCoop/index-coop-smart-contracts.git"
5455
},
55-
"author": "felix2feng",
56+
"author": "IndexCoop",
5657
"license": "MIT",
57-
"homepage": "https://github.com/SetProtocol",
58+
"homepage": "https://github.com/IndexCoop",
5859
"devDependencies": {
5960
"@nomiclabs/hardhat-ethers": "^2.0.1",
6061
"@nomiclabs/hardhat-waffle": "^2.0.1",
@@ -96,6 +97,7 @@
9697
"fs-extra": "^5.0.0",
9798
"module-alias": "^2.2.2",
9899
"replace-in-file": "^6.1.0",
100+
"semantic-release": "^19.0.2",
99101
"typechain": "^4.0.1"
100102
},
101103
"peerDependencies": {

0 commit comments

Comments
 (0)