Skip to content

Commit

Permalink
chore: added interface exporter task (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmoebius authored Aug 14, 2023
1 parent 7e1912d commit 9af21a8
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 61 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/canary.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/interfaces-canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Interface Exporter Action - Canary

on: workflow_dispatch

jobs:
generate-and-publish-interfaces:
name: Generate Interfaces (canary)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Build project and generate out directory
run: yarn build

- name: Export Interfaces - web3-v1
uses: defi-wonderland/[email protected]
with:
out_dir: "out"
publish_type: "web3-v1"
package_name: "opoo-interface-web3-v1"
destination_dir: "exported-interfaces"

- name: Export Interfaces - ethers-v6
uses: defi-wonderland/[email protected]
with:
out_dir: "out"
publish_type: "ethers-v6"
package_name: "opoo-interface-ethers-v6"
destination_dir: "exported-interfaces"

- name: Export Interfaces - ABI
uses: defi-wonderland/[email protected]
with:
out_dir: "out"
publish_type: "abi"
package_name: "opoo-interface-abi"
destination_dir: "exported-interfaces"

- name: Publish
run: cd exported-interfaces && npm publish --access public --tag canary
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Production release
name: Interface Exporter Action - Production

on:
push:
Expand Down Expand Up @@ -35,36 +35,55 @@ jobs:
draft: false
prerelease: false

publish:
name: Build and publish
generate-and-publish-interfaces:
name: Generate Interfaces
runs-on: ubuntu-latest
needs: tag
if: needs.tag.outputs.tag_name

steps:
- name: Checkout repo
uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Install node
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: 16
registry-url: "https://registry.npmjs.org"
cache: "yarn"

- name: Install dependencies
run: yarn --frozen-lockfile --network-concurrency 1
run: yarn --frozen-lockfile

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Build project and generate out directory
run: yarn build

- name: Export Interfaces - web3-v1
uses: defi-wonderland/[email protected]
with:
version: nightly
out_dir: "out"
publish_type: "web3-v1"
package_name: "opoo-interface-web3-v1"
destination_dir: "exported-interfaces"

- name: Build
run: yarn build
- name: Export Interfaces - ethers-v6
uses: defi-wonderland/[email protected]
with:
out_dir: "out"
publish_type: "ethers-v6"
package_name: "opoo-interface-ethers-v6"
destination_dir: "exported-interfaces"

- name: Export Interfaces - ABI
uses: defi-wonderland/[email protected]
with:
out_dir: "out"
publish_type: "abi"
package_name: "opoo-interface-abi"
destination_dir: "exported-interfaces"

- name: Publish
run: |
cd npm
npm publish --access public
run: cd exported-interfaces && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 9af21a8

Please sign in to comment.