Skip to content

Commit

Permalink
feat: update solidity exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
0xShaito committed Aug 8, 2024
1 parent 1e64630 commit 71145a8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 24 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ on: workflow_dispatch
jobs:
export:
name: Generate Interfaces And Contracts
# Remove the following line if you wish to export your Solidity contracts and interfaces and publish them to NPM

# 1) Remove the following line if you wish to export your Solidity contracts and interfaces and publish them to NPM
if: false
runs-on: ubuntu-latest
strategy:
matrix:
export_type: ['interfaces', 'contracts']
export_type: ['interfaces', 'all']

env:
# 2) Fill the project name to be used in NPM
PROJECT_NAME: 'my-cool-project'
EXPORT_NAME: ${{ matrix.export_type == 'interfaces' && '-interfaces' || '' }}

steps:
- name: Checkout Repo
Expand All @@ -37,18 +43,17 @@ jobs:
- name: Update version
run: yarn version --new-version "0.0.0-${GITHUB_SHA::8}" --no-git-tag-version

- name: Export Solidity - ${{ matrix.export_type }}
uses: defi-wonderland/solidity-exporter-action@v2.0.0
- name: Export Solidity - Export Type ${{ matrix.export_type }}
uses: defi-wonderland/solidity-exporter-action@v2.1.0
with:
# Update package_name with your package name
package_name: 'my-cool-project'
package_name: ${{ env.PROJECT_NAME }}
out: 'out'
interfaces: 'src/interfaces'
contracts: 'src/contracts'
interfaces: 'solidity/interfaces'
contracts: 'solidity/contracts'
libraries: "solidity/libraries"
export_type: '${{ matrix.export_type }}'

- name: Publish to NPM - ${{ matrix.export_type }}
# Update `my-cool-project` with your package name
run: cd export/my-cool-project-${{ matrix.export_type }} && npm publish --access public --tag canary
- name: Publish to NPM - Export Type ${{ matrix.export_type }}
run: cd export/${{ env.PROJECT_NAME }}${{ env.EXPORT_NAME }} && npm publish --access public --tag canary
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
29 changes: 17 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ on:
jobs:
release:
name: Release
# Remove the following line if you wish to export your Solidity contracts and interfaces and publish them to NPM

# 1) Remove the following line if you wish to export your Solidity contracts and interfaces and publish them to NPM
if: false
runs-on: ubuntu-latest
strategy:
matrix:
export_type: ['interfaces', 'contracts']
export_type: ['interfaces', 'all']

env:
# 2) Fill the project name to be used in NPM
PROJECT_NAME: 'my-cool-project'
EXPORT_NAME: ${{ matrix.export_type == 'interfaces' && '-interfaces' || '' }}

steps:
- name: Checkout Repo
Expand All @@ -36,18 +42,17 @@ jobs:
- name: Build project and generate out directory
run: yarn build

- name: Export Solidity - ${{ matrix.export_type }}
uses: defi-wonderland/solidity-exporter-action@v2.0.0
- name: Export Solidity - Export Type ${{ matrix.export_type }}
uses: defi-wonderland/solidity-exporter-action@v2.1.0
with:
# Update package_name with your package name
package_name: 'my-cool-project'
package_name: ${{ env.PROJECT_NAME }}
out: 'out'
interfaces: 'src/interfaces'
contracts: 'src/contracts'
interfaces: 'solidity/interfaces'
contracts: 'solidity/contracts'
libraries: "solidity/libraries"
export_type: '${{ matrix.export_type }}'

- name: Publish to NPM - ${{ matrix.export_type }}
# Update `my-cool-project` with your package name
run: cd export/my-cool-project-${{ matrix.export_type }} && npm publish --access public --tag latest
- name: Publish to NPM - Export Type ${{ matrix.export_type }}
run: cd export/${{ env.PROJECT_NAME }}${{ env.EXPORT_NAME }} && npm publish --access public
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 71145a8

Please sign in to comment.