Skip to content

Commit

Permalink
feat: publishing (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsains authored Sep 5, 2023
1 parent cf24855 commit 70ef02f
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 7 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/publish_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: publish:ci

on:
pull_request:
types: [closed]
branches:
- main
push:
tags:
- '*'

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Publish
run: npm publish
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -392,4 +392,5 @@ lib
.vscode
junit.xml
test-report.xml
.env
.env
.secrets
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,27 @@ npm run build:watch
```

# Running the app

## CLI help

Specific details on what commands are available can be shown running:

```
npm run adapters-cli
```

For getting the arguments and options for specific commands:

```
npm run positions -- --help
```

## Filtering

It is possible to get results for specific protocols and chains for every command by adding `--chain <chainId>` and/or `--protocol <protocolName>`

For example:

```
npm run positions 0x6b8Be925ED8277fE4D27820aE4677e76Ebf4c255 -- --protocol stargate --chain 1
```
Expand Down Expand Up @@ -162,11 +169,13 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
## Adding a new Adapter (CLI)

Run the following command to add a new adapter

```
npm run new-adapter <Example> <example-product> [Chains]
```

Where:

- `<Example>` is the name of your protocol as you'd like it to appear.
- `<example-product>` is the name of the product for the adapter in kebab-case
- `[Chains]` is an optional argument with a comma separated list of supported chains (e.g. `Ethereum,Arbitrum,Optimism`). Default: `Ethereum`
Expand Down Expand Up @@ -205,6 +214,17 @@ Run the following command to generate factories and abis for those contracts aut
npm run build-types
```

## Versioning and Publishing (internal use only)

On your branch, bump the package version by running the below. The publish_ci pipeline will automatically-run when merged to main.

npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]

```
npm version patch
git push
```

# Contributors ✨

<table>
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
{
"name": "mmi-defi-adapters",
"version": "0.0.1",
"name": "@metamask-institutional/defi-adapters",
"version": "0.2.4",
"description": "Defi adapters for MMI Dashboard",
"author": "MMI Team",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/consensys-vertical-apps/mmi-defi-adapters"
},
"main": "lib/main/index.js",
"types": "lib/main/index.d.ts",
"files": [
Expand Down

0 comments on commit 70ef02f

Please sign in to comment.