From 589bf1aa86bf91d08a1f19ea7d3fc0fdbaf85586 Mon Sep 17 00:00:00 2001 From: MK Date: Thu, 20 Nov 2025 21:02:11 +0800 Subject: [PATCH 1/6] chore: enable auto release --- .autod.conf.js | 40 ----------------------------------- .github/workflows/nodejs.yml | 6 +++--- .github/workflows/release.yml | 18 ++++++++++++++++ package.json | 4 +--- 4 files changed, 22 insertions(+), 46 deletions(-) delete mode 100644 .autod.conf.js create mode 100644 .github/workflows/release.yml diff --git a/.autod.conf.js b/.autod.conf.js deleted file mode 100644 index c5861d4..0000000 --- a/.autod.conf.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -module.exports = { - write: true, - prefix: '^', - test: [ - 'test', - ], - dep: [ - 'address', - 'formstream', - 'moment', - 'nounou', - 'p-map', - 'split2', - 'through2', - 'urllib', - 'uuid', - 'ws', - ], - devdep: [ - 'autod', - 'codecov', - 'eslint', - 'eslint-config-egg', - 'expect.js', - 'mocha', - 'nodemon', - 'nyc' - ], - exclude: [ - './scripts', - './test/fixtures', - './demo.js', - ], - semver: [ - 'eslint@6', - 'mocha@7' - ] -}; diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index d770f9a..bf0c4f7 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -1,9 +1,9 @@ name: Continuous integration on: push: - branches: [ '**' ] + branches: [ master ] pull_request: - branches: [ '**' ] + branches: [ master ] jobs: Runner: runs-on: ${{ matrix.os }} @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@master - name: Setup Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..42ec41d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,18 @@ +name: Release +on: + push: + branches: [ master ] + +permissions: + contents: write + deployments: write + issues: write + pull-requests: write + id-token: write + +jobs: + release: + name: NPM + uses: X-Profiler/github-actions/.github/workflows/npm-release.yml@master + secrets: + GIT_TOKEN: ${{ secrets.GIT_TOKEN }} diff --git a/package.json b/package.json index c93c646..d3695fe 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,7 @@ "cov": "nyc --reporter=html --reporter=text --reporter=lcov mocha -R spec test/*.test.js --timeout 0", "cov-single": "nyc --reporter=html --reporter=text --reporter=lcov mocha --timeout 0 -R spec", "ci": "npm run lint && npm run cov", - "release": "node scripts/release.js", - "autod": "autod" + "release": "node scripts/release.js" }, "repository": { "type": "git", @@ -54,7 +53,6 @@ "ws": "^8.18.0" }, "devDependencies": { - "autod": "^3.1.0", "eslint": "^8.57.1", "eslint-config-egg": "^14.0.0", "expect.js": "^0.3.1", From 209730115cd4d30b7fdd418e71ff6df962185daf Mon Sep 17 00:00:00 2001 From: MK Date: Thu, 20 Nov 2025 21:07:40 +0800 Subject: [PATCH 2/6] FIXUP --- .github/workflows/nodejs.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index bf0c4f7..5681bca 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -10,7 +10,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] + # use windows-2022, avoid error: 'wmic' is not recognized as an internal or external command + os: [ ubuntu-latest, macos-latest, windows-2022 ] node-version: [ 16, 18, 20, 22 ] steps: - name: Checkout Git Source @@ -26,8 +27,8 @@ jobs: - name: Continuous integration on win32 run: npm run test - if: ${{ matrix.os == 'windows-latest' }} + if: ${{ matrix.os == 'windows-2022' }} - name: Continuous integration on linux & darwin run: npm run ci - if: ${{ matrix.os != 'windows-latest' }} + if: ${{ matrix.os != 'windows-2022' }} From d71b0d3688ba18ee049342b99ef24140a4f3b032 Mon Sep 17 00:00:00 2001 From: MK Date: Thu, 20 Nov 2025 21:09:16 +0800 Subject: [PATCH 3/6] FIXUP --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 5681bca..d6bd1ca 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -12,7 +12,7 @@ jobs: matrix: # use windows-2022, avoid error: 'wmic' is not recognized as an internal or external command os: [ ubuntu-latest, macos-latest, windows-2022 ] - node-version: [ 16, 18, 20, 22 ] + node-version: [ 16, 18, 20, 22, 24 ] steps: - name: Checkout Git Source uses: actions/checkout@master From 27ae98bb47340b013a361ea7645440e0a0a08e4f Mon Sep 17 00:00:00 2001 From: MK Date: Thu, 20 Nov 2025 21:10:18 +0800 Subject: [PATCH 4/6] FIXUP --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bf51e7e..ebe07ee 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,10 @@ The agent that can collect or transfer xprofiler's performance logs. ## I. License -[BSD-2-Clause](LICENSE) \ No newline at end of file +[BSD-2-Clause](LICENSE) + +## Contributors + +[![Contributors](https://contrib.rocks/image?repo=X-Profiler/xtransit)](https://github.com/X-Profiler/xtransit/graphs/contributors) + +Made with [contributors-img](https://contrib.rocks). From b0912b1f6f4893a8e8df2312ff86775188046a02 Mon Sep 17 00:00:00 2001 From: MK Date: Thu, 20 Nov 2025 21:12:07 +0800 Subject: [PATCH 5/6] FIXUP --- .github/workflows/nodejs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index d6bd1ca..c53fa72 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -4,6 +4,7 @@ on: branches: [ master ] pull_request: branches: [ master ] + merge_group: jobs: Runner: runs-on: ${{ matrix.os }} From dac01df1f0f7407ba2dbdee82b306c4dfb414de2 Mon Sep 17 00:00:00 2001 From: MK Date: Thu, 20 Nov 2025 21:14:15 +0800 Subject: [PATCH 6/6] FIXUP --- package.json | 3 +-- scripts/release.js | 26 -------------------------- 2 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 scripts/release.js diff --git a/package.json b/package.json index d3695fe..eac637d 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,7 @@ "test-single": "mocha -t 0 -R spec", "cov": "nyc --reporter=html --reporter=text --reporter=lcov mocha -R spec test/*.test.js --timeout 0", "cov-single": "nyc --reporter=html --reporter=text --reporter=lcov mocha --timeout 0 -R spec", - "ci": "npm run lint && npm run cov", - "release": "node scripts/release.js" + "ci": "npm run lint && npm run cov" }, "repository": { "type": "git", diff --git a/scripts/release.js b/scripts/release.js deleted file mode 100644 index 828b445..0000000 --- a/scripts/release.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -const cp = require('node:child_process'); -const path = require('node:path'); -const pack = require('../package.json'); - -const releaseVersion = pack.version; -const releaseInfo = `${pack.name}@${releaseVersion}`; -console.log(`will release ${releaseInfo}...\n`); - -function run(cmd) { - console.log(`Run: ${cmd}`); - const options = { cwd: path.join(__dirname, '..'), maxBuffer: 4 * 1024 * 1024, stdio: 'inherit' }; - cp.execSync(cmd, options); -} - -// release tag -const tagName = `v${releaseVersion}`; -// run(`git tag -d ${tagName}`); -run(`git tag ${tagName}`); -run(`git push -f origin ${tagName}`); - -// publish to npm -run('npm publish --registry=https://registry.npmjs.org'); - -console.log(`\nrelease ${releaseInfo} done.`);