From 9bee03c1f1498c26f690555f6761f5206c41b09a Mon Sep 17 00:00:00 2001 From: Bradley Xu Date: Wed, 25 Sep 2024 21:31:29 +0800 Subject: [PATCH] chore: using pkg.pr.new for pr release and improve setup script (#656) --- .github/workflows/ci.yml | 2 +- .github/workflows/pr.yml | 24 ++++++++++++++++++++++++ .github/workflows/release.yml | 10 +++------- .github/workflows/version.yml | 10 +++------- package.json | 2 +- 5 files changed, 32 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fea30268..7521bbad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: uses: pnpm/action-setup@v2 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 00000000..7758057c --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,24 @@ +name: Pull Request Check +on: [pull_request] + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout Branch + uses: actions/checkout@v3 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + cache: 'pnpm' + + - name: Setup + run: pnpm run setup + + - run: pnpx pkg-pr-new publish './packages/*' --template './examples/*' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2f53f419..12380c3a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,10 +10,6 @@ jobs: name: Release runs-on: ubuntu-latest - strategy: - matrix: - node-version: [18] - steps: - name: Checkout Branch uses: actions/checkout@v3 @@ -21,10 +17,10 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + - name: Setup Node.js + uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: 18 cache: 'pnpm' - name: Setup diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 4e50ce01..3a15044a 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -10,10 +10,6 @@ jobs: name: Version runs-on: ubuntu-latest - strategy: - matrix: - node-version: [18] - steps: - name: Checkout Branch uses: actions/checkout@v3 @@ -21,10 +17,10 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + - name: Setup Node.js + uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: 18 cache: 'pnpm' - name: Setup diff --git a/package.json b/package.json index bcfae486..ea709d93 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "description": "The next generation of npm package development kit.", "scripts": { "preinstall": "npx only-allow pnpm", - "setup": "rm -rf node_modules && rm -rf ./packages/*/node_modules && pnpm i && pnpm run build", + "setup": "pnpm i && pnpm run build", "build": "pnpm run clean && pnpm -r --filter=./packages/* run build", "watch": "pnpm --parallel --filter=./packages/* run watch", "clean": "rm -rf packages/*/lib",