diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a59b35..e5e98c7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,33 @@ on: - "*.*.*" jobs: + release-npm: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + registry-url: https://registry.npmjs.org + + # npm >= 11.5.1 is required for OIDC trusted publishing. + - name: Update npm + run: npm install -g npm@latest + + - name: Verify package version matches tag + run: test "$(node --print "require('./package.json').version")" = "${GITHUB_REF_NAME}" + + - name: Publish to npm + run: npm publish --access public --ignore-scripts=true + release-github: permissions: contents: write diff --git a/README.md b/README.md index 85d5811..562c954 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,22 @@ live in `examples/micro-patterns`. ## Installation +### Using npm + +Install the package: + +```bash +npm install @phylax-systems/credible-std +``` + +Add these remappings to your `remappings.txt`: + +``` +credible-std/=node_modules/@phylax-systems/credible-std/src/ +forge-std/=node_modules/@phylax-systems/credible-std/lib/forge-std/src/ +@openzeppelin/=node_modules/@phylax-systems/credible-std/lib/openzeppelin-contracts/ +``` + ### Using Foundry (Recommended) Install the latest stable release: diff --git a/package.json b/package.json new file mode 100644 index 0000000..405ba8c --- /dev/null +++ b/package.json @@ -0,0 +1,36 @@ +{ + "name": "@phylax-systems/credible-std", + "description": "Solidity standard library for writing Credible Layer assertions", + "version": "0.8.0", + "license": "MIT", + "author": { + "name": "Phylax Systems", + "url": "https://phylax.systems" + }, + "files": [ + "lib/forge-std/src", + "lib/openzeppelin-contracts/contracts", + "scripts/backtesting/transaction_fetcher.sh", + "src", + "README.md" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/phylaxsystems/credible-std.git" + }, + "keywords": [ + "solidity", + "ethereum", + "smart-contracts", + "credible-layer", + "assertions" + ], + "bugs": { + "url": "https://github.com/phylaxsystems/credible-std/issues" + }, + "homepage": "https://github.com/phylaxsystems/credible-std#readme", + "publishConfig": { + "access": "public", + "provenance": true + } +}