Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug: use npx in preinstall #912

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/test-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: test-npm

on:
push:
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"cli-kintone": "cli.js"
},
"scripts": {
"preinstall": "npx only-allow pnpm",
"preinstall": "npx github:pnpm/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",
Expand Down
Loading