Skip to content

feat: npm exporter action #1

feat: npm exporter action

feat: npm exporter action #1

Workflow file for this run

name: Release
on: [push]
jobs:
release:
name: Release
runs-on: ubuntu-latest
strategy:
matrix:
export_type: ['interfaces', 'all']
env:
PROJECT_NAME: '@allo-protocol/allo-v2.1'
EXPORT_NAME: ${{ matrix.export_type == 'interfaces' && '-interfaces' || '' }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup bun env
uses: oven-sh/setup-bun@v1
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install dependencies
run: bun install
- name: Build project and generate out directory
run: bun run build
- name: Export Solidity - Export Type ${{ matrix.export_type }}
uses: defi-wonderland/[email protected]
with:
package_name: ${{ env.PROJECT_NAME }}
out: 'out'
interfaces: 'contracts/core/interfaces'
contracts: 'contracts/core'
libraries: "contracts/core/libraries"
export_type: '${{ matrix.export_type }}'
- name: Publish to NPM
run: cd export/${{ env.PROJECT_NAME }}${{ env.EXPORT_NAME }} && npm publish --access public --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}