From 9af21a84744f427f59880742b459fb6caf0e8e73 Mon Sep 17 00:00:00 2001 From: moebius <132487952+0xmoebius@users.noreply.github.com> Date: Mon, 14 Aug 2023 10:08:57 -0300 Subject: [PATCH] chore: added interface exporter task (#77) --- .github/workflows/canary.yml | 42 -------------- .github/workflows/interfaces-canary.yml | 57 +++++++++++++++++++ .../{release.yml => interfaces-prod.yml} | 57 ++++++++++++------- 3 files changed, 95 insertions(+), 61 deletions(-) delete mode 100644 .github/workflows/canary.yml create mode 100644 .github/workflows/interfaces-canary.yml rename .github/workflows/{release.yml => interfaces-prod.yml} (51%) diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml deleted file mode 100644 index d23275c2..00000000 --- a/.github/workflows/canary.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Canary release - -on: workflow_dispatch - -jobs: - canary-publish: - name: Publish Packages (canary) - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Install node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - registry-url: "https://registry.npmjs.org" - cache: "yarn" - - - name: Install dependencies - run: yarn --frozen-lockfile --network-concurrency 1 - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - - name: Build - run: yarn build - - - name: Update version - run: | - cd npm - yarn version --new-version "0.0.0-${GITHUB_SHA::8}" --no-git-tag-version - - - name: Publish - run: | - cd npm - npm publish --access public --tag canary - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/interfaces-canary.yml b/.github/workflows/interfaces-canary.yml new file mode 100644 index 00000000..3fd20fe0 --- /dev/null +++ b/.github/workflows/interfaces-canary.yml @@ -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/interface-exporter-action@v1.0.0 + 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/interface-exporter-action@v1.0.0 + 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/interface-exporter-action@v1.0.0 + 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 }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/interfaces-prod.yml similarity index 51% rename from .github/workflows/release.yml rename to .github/workflows/interfaces-prod.yml index e85659f5..531c967d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/interfaces-prod.yml @@ -1,4 +1,4 @@ -name: Production release +name: Interface Exporter Action - Production on: push: @@ -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/interface-exporter-action@v1.0.0 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/interface-exporter-action@v1.0.0 + 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/interface-exporter-action@v1.0.0 + 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 }}