diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..14b7f81 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,39 @@ +--- +name: "Publish to NPM" +on: + release: + types: + - "published" + +jobs: + publish: + name: Publish to NPM + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-node@v6 + with: + cache-dependency-path: ./yarn.lock + cache: "yarn" + node-version: 20 + + - uses: bahmutov/npm-install@v1 + with: + useLockFile: false + + - name: Build + run: yarn build + + - name: Write release version + run: | + VERSION=${GITHUB_REF_NAME#v} + echo Version: $VERSION + echo "VERSION=$VERSION" >> $GITHUB_ENV + + - run: "npm version ${VERSION} --no-git-tag-version" + + - uses: JS-DevTools/npm-publish@v4 + with: + token: ${{ secrets.NPM_TOKEN }} + access: public diff --git a/package.json b/package.json index 02d1f47..2f14ba9 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,21 @@ { "name": "@permify/permify-node", - "version": "1.0.10", + "version": "1.1.0", "description": "Permify Node Client", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", "repository": "https://github.com/Permify/permify-node", "private": false, + "files": [ + "dist", + "README.md", + "LICENSE" + ], "scripts": { "run-instance": "scripts/run-instance.sh", "run-test": "ts-node node_modules/jasmine/bin/jasmine --config=jasmine.json", "lint": "eslint \"src/**/*.ts\"", - "build": "rm -rf ./dist && npx tsc", + "build": "npx tsc", "buf:generate": "buf generate" }, "keywords": [ @@ -26,6 +31,8 @@ "license": "Apache-2.0", "dependencies": { "@grpc/grpc-js": "^1.9.0", + "@protobuf-ts/runtime": "^2.9.1", + "@protobuf-ts/runtime-rpc": "^2.9.1", "nice-grpc": "^2.1.9", "nice-grpc-common": "^2.0.0", "long": "^5.2.3" diff --git a/yarn.lock b/yarn.lock index 30c9fa9..ed8de04 100644 --- a/yarn.lock +++ b/yarn.lock @@ -748,6 +748,18 @@ resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.2.9.tgz#d229a7b7f9dac167a156992ef23c7f023653f53b" integrity sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA== +"@protobuf-ts/runtime-rpc@^2.9.1": + version "2.11.1" + resolved "https://registry.yarnpkg.com/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.11.1.tgz#a6eb2f384bceae8d23a01d0b0e37faf0af36c179" + integrity sha512-4CqqUmNA+/uMz00+d3CYKgElXO9VrEbucjnBFEjqI4GuDrEQ32MaI3q+9qPBvIGOlL4PmHXrzM32vBPWRhQKWQ== + dependencies: + "@protobuf-ts/runtime" "^2.11.1" + +"@protobuf-ts/runtime@^2.11.1", "@protobuf-ts/runtime@^2.9.1": + version "2.11.1" + resolved "https://registry.yarnpkg.com/@protobuf-ts/runtime/-/runtime-2.11.1.tgz#ee2bf2fac6e2d8deac0ca63471a77481548e5553" + integrity sha512-KuDaT1IfHkugM2pyz+FwiY80ejWrkH1pAtOBOZFuR6SXEFTsnb/jiQWQ1rCIrcKx2BtyxnxW6BWwsVSA/Ie+WQ== + "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf"