From 4fcc82a1ba02145efa3ab0ee78b9c6e137072dd5 Mon Sep 17 00:00:00 2001 From: Masaharu Tashiro Date: Thu, 24 Oct 2024 01:12:41 +0900 Subject: [PATCH 1/2] fix: remove `preinstall` --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 709d200ea5..7d613ee09a 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "cli-kintone": "cli.js" }, "scripts": { - "preinstall": "npx only-allow pnpm", "start": "run-s clean:lib 'build:tsc --watch'", "build": "run-s clean:lib build:tsc", "build:all": "run-s build build:artifacts", From 23701a1aca8211b5ade26946bcb83c9c50a0be6d Mon Sep 17 00:00:00 2001 From: Masaharu Tashiro Date: Thu, 24 Oct 2024 01:20:17 +0900 Subject: [PATCH 2/2] ci: add test-npm workflow --- .github/workflows/test-npm.yml | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/test-npm.yml diff --git a/.github/workflows/test-npm.yml b/.github/workflows/test-npm.yml new file mode 100644 index 0000000000..b8cb60a91e --- /dev/null +++ b/.github/workflows/test-npm.yml @@ -0,0 +1,64 @@ +name: test-npm + +on: + push: + branches: + - main + - "renovate/**" + pull_request: + +jobs: + prepare: + name: Prepare npm package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + - uses: actions/setup-node@v4 + with: + node-version: "18" + cache: "pnpm" + + - run: pnpm install --frozen-lockfile + - run: pnpm build + - run: pnpm pack + - run: mv kintone-cli-*.tgz kintone-cli.tgz + - uses: actions/upload-artifact@v4 + with: + name: kintone-cli.tgz + path: kintone-cli.tgz + + test-install: + name: Test npm install - Node.js ${{ matrix.os }} ${{ matrix.node-version }} + needs: prepare + runs-on: ${{ matrix.os }} + strategy: + matrix: + node-version: [22.x, 20.x, 18.x] + os: [ubuntu-latest, windows-latest, macos-latest] + steps: + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - uses: actions/download-artifact@v4 + with: + name: kintone-cli.tgz + - run: npm install -g kintone-cli.tgz + - run: cli-kintone --version + + test-npx: + name: Test npx - Node.js ${{ matrix.os }} ${{ matrix.node-version }} + needs: prepare + runs-on: ${{ matrix.os }} + strategy: + matrix: + node-version: [22.x, 20.x, 18.x] + os: [ubuntu-latest, windows-latest, macos-latest] + steps: + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - uses: actions/download-artifact@v4 + with: + name: kintone-cli.tgz + - run: npx kintone-cli.tgz --version