|
| 1 | +name: Publish CoFHE Errors to NPM |
| 2 | +on: |
| 3 | + release: |
| 4 | + types: [published] |
| 5 | + workflow_dispatch: |
| 6 | + push: # Temporary for testing |
| 7 | + branches: |
| 8 | + - feat/error-identifier-script |
| 9 | +jobs: |
| 10 | + publish-errors: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + name: Extract and Publish Errors |
| 13 | + permissions: |
| 14 | + contents: read |
| 15 | + id-token: write # Required for NPM provenance |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v3 |
| 18 | + |
| 19 | + - uses: actions/setup-node@v4 |
| 20 | + with: |
| 21 | + node-version: 20.x |
| 22 | + registry-url: 'https://registry.npmjs.org' |
| 23 | + |
| 24 | + - name: Install dependencies |
| 25 | + working-directory: contracts/internal/host-chain |
| 26 | + run: npm install |
| 27 | + |
| 28 | + - name: Extract errors and publish to NPM |
| 29 | + uses: roeezolantz/solidity-error-identifier-action@master |
| 30 | + env: |
| 31 | + KEY: '0x0000000000000000000000000000000000000000000000000000000000000001' |
| 32 | + KEY2: '0x0000000000000000000000000000000000000000000000000000000000000002' |
| 33 | + AGGREGATOR_KEY: '0x0000000000000000000000000000000000000000000000000000000000000003' |
| 34 | + with: |
| 35 | + mode: 'compile' |
| 36 | + contract_paths: 'contracts' |
| 37 | + compiler: 'hardhat' |
| 38 | + working_directory: 'contracts/internal/host-chain' |
| 39 | + output_path: 'cofhe-errors.json' |
| 40 | + publish_npm: 'true' |
| 41 | + npm_package_name: '@fhenixprotocol/cofhe-errors' |
| 42 | + npm_binary_name: 'cofhe-errors' |
| 43 | + package_description: 'Error definitions and identifiers for CoFHE smart contracts' |
| 44 | + package_keywords: 'cofhe, fhe, homomorphic-encryption, errors, solidity, smart-contracts, fhenix' |
| 45 | + npm_token: ${{ secrets.NPM_TOKEN }} |
| 46 | + npm_provenance: 'true' |
| 47 | + |
| 48 | + - name: Upload errors file |
| 49 | + run: ls -la cofhe-errors.json # Verify file exists in root |
| 50 | + |
| 51 | + - name: Upload errors database |
| 52 | + uses: actions/upload-artifact@v4 |
| 53 | + with: |
| 54 | + name: cofhe-errors |
| 55 | + path: cofhe-errors.json |
0 commit comments