Skip to content

test

test #13

name: Publish CoFHE Errors to NPM
on:
release:
types: [published]
workflow_dispatch: # Allow manual trigger for testing
push: # Temporary for testing
branches:
- test-fix-publish
jobs:
publish-errors:
runs-on: ubuntu-latest
name: Extract and Publish Errors
permissions:
contents: read
id-token: write # Required for NPM provenance
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 20.x
# Don't set registry-url when using NPM Trusted Publishers with OIDC
# This prevents actions/setup-node from creating .npmrc that requires NODE_AUTH_TOKEN
- name: Install dependencies
working-directory: contracts/internal/host-chain
run: npm install
- name: Clear NODE_AUTH_TOKEN
run: |
echo "NODE_AUTH_TOKEN=" >> $GITHUB_ENV
- name: Extract errors and publish to NPM
uses: roeezolantz/solidity-error-identifier-action@master
env:
KEY: "0x0000000000000000000000000000000000000000000000000000000000000001"
KEY2: "0x0000000000000000000000000000000000000000000000000000000000000002"
AGGREGATOR_KEY: "0x0000000000000000000000000000000000000000000000000000000000000003"
with:
mode: "compile"
contract_paths: "contracts"
compiler: "hardhat"
working_directory: "contracts/internal/host-chain"
output_path: "cofhe-errors.json"
publish_npm: "true"
npm_package_name: "@fhenixprotocol/cofhe-errors"
npm_binary_name: "cofhe-errors"
npm_provenance: "true"
# Using NPM Trusted Publishers with OIDC - no token needed
- name: Upload errors file
run: ls -la cofhe-errors.json # Verify file exists in root
- name: Upload errors database
uses: actions/upload-artifact@v4
with:
name: cofhe-errors
path: cofhe-errors.json