From a834d7b5c6c23e1b1e9f29e68fcadcd108a4d8ce Mon Sep 17 00:00:00 2001 From: qd-qd Date: Wed, 8 May 2024 12:21:01 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20fix=20npm=20publishing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-package.yml | 18 +++++++--------- .npmignore | 5 ++++- README.md | 31 ++++++++++++++++----------- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml index 18f6d68..7b62966 100644 --- a/.github/workflows/release-package.yml +++ b/.github/workflows/release-package.yml @@ -19,7 +19,7 @@ jobs: id: create_release uses: "marvinpinto/action-automatic-releases@v1.2.1" with: - repo_token: "${{ secrets.SMOOTH_QDQD_SECP256R1_RELEASE_TOKEN }}" + repo_token: "${{ secrets.GITHUB_TOKEN }}" prerelease: false deploy-doc: @@ -47,15 +47,13 @@ jobs: publish-gpr: needs: ["release"] runs-on: ubuntu-latest - permissions: - packages: write - contents: read steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v4 with: - node-version: 18 - registry-url: https://npm.pkg.github.com/ - - run: npm publish + node-version: "20.x" + registry-url: "https://registry.npmjs.org" + - run: npm publish --provenance --access public env: - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.npmignore b/.npmignore index 84cb373..fcd1cec 100644 --- a/.npmignore +++ b/.npmignore @@ -2,4 +2,7 @@ node_modules # the directory where all the tests belong -tests +test + +# the directory where all the build files belong +out diff --git a/README.md b/README.md index f8a0538..9d90bb1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -> This repository is currently under development and not ready for production use ⚠️ +> ❌ This repository is deprecated. Please refer to the [crypto-lib](https://github.com/get-smooth/CryptoLib) repository +> to find the latest implementation of the secp256r1 curve. # secp256r1 verify @@ -10,21 +11,16 @@ [github-editor-url]: https://github.dev/get-smooth/secp256r1-verify/tree/main [github-editor-badge]: https://img.shields.io/badge/Github-Open%20the%20Editor-purple?logo=github -[gha-quality-url]: - https://github.com/get-smooth/secp256r1-verify/actions/workflows/quality-checks.yml +[gha-quality-url]: https://github.com/get-smooth/secp256r1-verify/actions/workflows/quality-checks.yml [gha-quality-badge]: https://github.com/get-smooth/secp256r1-verify/actions/workflows/quality-checks.yml/badge.svg?branch=main [gha-test-url]: https://github.com/get-smooth/secp256r1-verify/actions/workflows/tests.yml -[gha-test-badge]: - https://github.com/get-smooth/secp256r1-verify/actions/workflows/tests.yml/badge.svg?branch=main -[gha-static-analysis-url]: - https://github.com/get-smooth/secp256r1-verify/actions/workflows/static-analysis.yml +[gha-test-badge]: https://github.com/get-smooth/secp256r1-verify/actions/workflows/tests.yml/badge.svg?branch=main +[gha-static-analysis-url]: https://github.com/get-smooth/secp256r1-verify/actions/workflows/static-analysis.yml [gha-static-analysis-badge]: https://github.com/get-smooth/template-foundry/actions/workflows/static-analysis.yml/badge.svg?branch=main -[gha-release-url]: - https://github.com/get-smooth/secp256r1-verify/actions/workflows/release-package.yml -[gha-release-badge]: - https://github.com/get-smooth/secp256r1-verify/actions/workflows/release-package.yml/badge.svg +[gha-release-url]: https://github.com/get-smooth/secp256r1-verify/actions/workflows/release-package.yml +[gha-release-badge]: https://github.com/get-smooth/secp256r1-verify/actions/workflows/release-package.yml/badge.svg [foundry]: https://book.getfoundry.sh/ [foundry-badge]: https://img.shields.io/badge/Built%20with-Foundry-FFDB1C.svg [license]: ./LICENSE.md @@ -53,6 +49,16 @@ This command will install the latest version of the package in your lib director library, follow the instructions in the [official Foundry documentation](https://book.getfoundry.sh/reference/forge/forge-install?highlight=forge%20install#forge-install). +### Hardhat or Truffle + +To install the `secp256r1-verify` package in a Hardhat or Truffle project, use `npm` to run the following command: + +```sh +npm install @smoo.th/secp256r1-verify +``` + +After the installation, import the package into your project and use it. + ## Usage This repository provides a unique verification implementation. After you've integrated this library into your project, @@ -82,8 +88,7 @@ scripts are expected to be run using the `forge script` command. ## Gas reports These gas reports were produced using the `0.8.19` version of the Solidity compiler (with 100k optimizer runs), -specifically for the -[`0.4.1`](https://github.com/get-smooth/secp256r1-verify/releases/tag/v0.4.1) version of the +specifically for the [`0.4.1`](https://github.com/get-smooth/secp256r1-verify/releases/tag/v0.4.1) version of the library. The library version corresponds to commit [4d0716f](https://github.com/get-smooth/secp256r1-verify/commit/4d0716fc6fd14a92488442e1dd0c18bb2c24ff41).