From b9870c82bb896b4b8135a2468a53cfe73c667967 Mon Sep 17 00:00:00 2001 From: MK Date: Tue, 11 Nov 2025 21:43:42 +0800 Subject: [PATCH 1/5] chore: use npm trust publish --- .github/workflows/nodejs.yml | 2 +- .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ History.md | 4 ++++ README.md | 9 ++------- package.json | 2 -- 5 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 6ec122f..d98ca07 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -40,7 +40,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [14, 16, 18, 20, 22] + node-version: [14, 16, 18, 20, 22, 24] os: [ubuntu-latest] steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1441224 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +# https://docs.npmjs.com/trusted-publishers +name: Publish Package + +on: + push: + tags: + - 'v*' + +permissions: + id-token: write # Required for OIDC + contents: read + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-node@v6 + with: + node-version: '24' + registry-url: 'https://registry.npmjs.org' + + - run: npm install + - run: npm run build --if-present + - run: npm test + - run: npm publish diff --git a/History.md b/History.md index 22bb0e4..0a9163e 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,7 @@ +## Changelog + +Please refer to [GitHub Releases](https://github.com/layotto/js-sdk/releases) for the latest changelog. + 1.17.0 / 2024-05-26 ================== diff --git a/README.md b/README.md index c1242b3..aa94c8f 100644 --- a/README.md +++ b/README.md @@ -115,14 +115,9 @@ GRPC_TRACE=compression GRPC_VERBOSITY=debug GRPC_TRACE=all npm run test test/uni [Apache License 2.0](LICENSE) - ## Contributors -|[
fengmk2](https://github.com/fengmk2)
|[
seeflood](https://github.com/seeflood)
|[
LZHK1ng](https://github.com/LZHK1ng)
|[
killagu](https://github.com/killagu)
| -| :---: | :---: | :---: | :---: | +[![Contributors](https://contrib.rocks/image?repo=layotto/js-sdk)](https://github.com/layotto/js-sdk/graphs/contributors) - -This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Thu Oct 13 2022 15:14:41 GMT+0800`. - - +Made with [contributors-img](https://contrib.rocks). diff --git a/package.json b/package.json index 0f854f6..12a20f8 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "proto" ], "scripts": { - "contributor": "git-contributor", "ci": "npm run lint && npm run build && npm run test:unit", "test": "jest --detectOpenHandles", "test:unit": "NODE_ENV=test npm run test 'test/unit/.*\\.test\\.ts'", @@ -46,7 +45,6 @@ "@types/pump": "^1.1.1", "eslint": "^8.31.0", "eslint-config-egg": "^12.1.0", - "git-contributor": "^1.1.0", "grpc-tools": "^1.11.3", "grpc_tools_node_protoc_ts": "^5.3.2", "jest": "^27.2.5", From ce2568765b4fbb928e280cb6af3f3dcf4407673a Mon Sep 17 00:00:00 2001 From: MK Date: Tue, 11 Nov 2025 21:49:00 +0800 Subject: [PATCH 2/5] FIXUP --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index aa94c8f..6bdd650 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,15 @@ Enable trace debug log for grpc-js: GRPC_TRACE=compression GRPC_VERBOSITY=debug GRPC_TRACE=all npm run test test/unit/client/Invoker.test.ts ``` +### NPM Publish + +Just run `npm version` command to update the version and push the tag to GitHub. + +```bash +npm version +git push origin main --tags +``` + ## Reference - [Core concepts, architecture and lifecycle](https://grpc.io/docs/what-is-grpc/core-concepts/) @@ -115,7 +124,6 @@ GRPC_TRACE=compression GRPC_VERBOSITY=debug GRPC_TRACE=all npm run test test/uni [Apache License 2.0](LICENSE) - ## Contributors [![Contributors](https://contrib.rocks/image?repo=layotto/js-sdk)](https://github.com/layotto/js-sdk/graphs/contributors) From c8a4722e12e621cf467cd941bee8d1b4be54d9a9 Mon Sep 17 00:00:00 2001 From: MK Date: Tue, 11 Nov 2025 21:50:27 +0800 Subject: [PATCH 3/5] FIXUP --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6bdd650..672244a 100644 --- a/README.md +++ b/README.md @@ -104,10 +104,10 @@ GRPC_TRACE=compression GRPC_VERBOSITY=debug GRPC_TRACE=all npm run test test/uni ### NPM Publish -Just run `npm version` command to update the version and push the tag to GitHub. +Just run `npm version ` command to update the version and push the tag to GitHub. ```bash -npm version +npm version git push origin main --tags ``` From e1a80220dd7f443b3dd58a2a5afcf25518bc0daa Mon Sep 17 00:00:00 2001 From: "MK (fengmk2)" Date: Tue, 11 Nov 2025 21:52:04 +0800 Subject: [PATCH 4/5] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1441224..4045e03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,6 +15,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 + with: + submodules: recursive - uses: actions/setup-node@v6 with: @@ -22,6 +24,6 @@ jobs: registry-url: 'https://registry.npmjs.org' - run: npm install - - run: npm run build --if-present + - run: npm test - run: npm publish From 52f84b459fd97246f28fa1b1dc2d1ee30293530a Mon Sep 17 00:00:00 2001 From: MK Date: Tue, 11 Nov 2025 21:52:28 +0800 Subject: [PATCH 5/5] FIXUP --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4045e03..4da27bd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,5 +25,4 @@ jobs: - run: npm install - - run: npm test - run: npm publish