diff --git a/.github/workflows/solidity-exporter.yml b/.github/workflows/solidity-exporter.yml index 64e0c0a9..8f1eddca 100644 --- a/.github/workflows/solidity-exporter.yml +++ b/.github/workflows/solidity-exporter.yml @@ -5,6 +5,7 @@ on: [push] jobs: export: name: Generate Interfaces And Contracts + if: false runs-on: ubuntu-latest strategy: matrix: @@ -42,9 +43,9 @@ jobs: interfaces: "solidity/interfaces" contracts: "solidity/contracts" export_type: "${{ matrix.export_type }}" - ## Uncomment it if you want to publish your exported packages to NPM - # - name: Publish - ## Update `@defi_wonderland/solidity-exported` with your package name - # run: cd export/@defi_wonderland/solidity-exported-${{ matrix.export_type }} && npm publish --access public - # env: - # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Publish to NPM - ${{ matrix.export_type }} + # Update `@defi_wonderland/solidity-exported` with your package name + run: cd export/@defi_wonderland/solidity-exported-${{ matrix.export_type }} && npm publish --access public + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index 5dbc6c1e..acb6098f 100644 --- a/README.md +++ b/README.md @@ -109,28 +109,37 @@ See the [Foundry Book for available options](https://book.getfoundry.sh/referenc ## Export And Publish -### Export +Export TypeScript interfaces from Solidity contracts and interfaces providing compatibility with TypeChain. Publish the exported packages to NPM. -Export TypeScript interfaces from Solidity contracts and interfaces providing compatibility with TypeChain. - -Update the `package_name` in the `solidity-exporter.yml` file to match your package name: +To enable this feature, make sure you've set the `NPM_TOKEN` on your org's secrets. Then set the job's conditional to `true`: ```yaml -# Update package_name with your package name -package_name: "@defi_wonderland/solidity-exported" -``` +solidity-exporter.yml -### Publish +jobs: + export: + name: Generate Interfaces And Contracts + if: true + ... +``` -If you want to publish the exported packages to NPM, you can do so by uncommenting the following lines in the `solidity-exporter.yml` file (make sure you've set the `NPM_TOKEN` on your org's secrets) and updating the package name with yours: +Also, remember to update the `package_name` param to your package name: ```yaml -## Uncomment it if you want to publish your exported packages to NPM -# - name: Publish -## Update `@defi_wonderland/solidity-exported` with your package name -# run: cd export/@defi_wonderland/solidity-exported-${{ matrix.export_type }} && npm publish --access public -# env: -# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} +solidity-exporter.yml + +- name: Export Solidity - ${{ matrix.export_type }} + uses: defi-wonderland/solidity-exporter-action@1dbf5371c260add4a354e7a8d3467e5d3b9580b8 + with: + # Update package_name with your package name + package_name: "@defi_wonderland/solidity-exported" + ... + + +- name: Publish to NPM - ${{ matrix.export_type }} + # Update `@defi_wonderland/solidity-exported` with your package name + run: cd export/@defi_wonderland/solidity-exported-${{ matrix.export_type }} && npm publish --access public + ... ``` You can take a look at our [solidity-exporter-action](https://github.com/defi-wonderland/solidity-exporter-action) repository more information and usage examples.