From f913e0b0278aea34c7c1d07b0eb53ac2425b6291 Mon Sep 17 00:00:00 2001 From: pk5ls20 Date: Sun, 17 Nov 2024 06:23:33 +0800 Subject: [PATCH] chore: workflow --- .github/workflows/build.yml | 85 ++++++++++++++----------------------- 1 file changed, 31 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26df38c9..975bd4c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,7 @@ name: "Build Action" on: push: - branches: - - main + pull_request: workflow_dispatch: permissions: write-all @@ -11,60 +10,38 @@ jobs: Build-LiteLoader: runs-on: ubuntu-latest steps: - - name: Clone Main Repository - uses: actions/checkout@v4 - with: - repository: 'NapNeko/NapCatQQ' - submodules: true - ref: main - token: ${{ secrets.NAPCAT_BUILD }} - - name: Use Node.js 20.X - uses: actions/setup-node@v4 - with: - node-version: 20.x - - name: Build NuCat Framework - run: | + - name: Clone Main Repository + uses: actions/checkout@v4 + - name: Use Node.js 20.X + uses: actions/setup-node@v4 + with: + node-version: 20.x + - name: Build NapCat.Framework + run: | npm i - cd napcat.webui - npm i - cd .. - npm run build:framework - cd dist - npm i --omit=dev + npm run build:framework && npm run depend rm package-lock.json - cd .. - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: NapCat.Framework - path: dist + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: NapCat.Framework + path: dist Build-Shell: runs-on: ubuntu-latest steps: - - name: Clone Main Repository - uses: actions/checkout@v4 - with: - repository: 'NapNeko/NapCatQQ' - submodules: true - ref: main - token: ${{ secrets.NAPCAT_BUILD }} - - name: Use Node.js 20.X - uses: actions/setup-node@v4 - with: - node-version: 20.x - - name: Build NuCat LiteLoader - run: | - npm i - cd napcat.webui - npm i - cd .. - npm run build:shell - cd dist - npm i --omit=dev - rm package-lock.json - cd .. - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: NapCat.Shell - path: dist + - name: Clone Main Repository + uses: actions/checkout@v4 + - name: Use Node.js 20.X + uses: actions/setup-node@v4 + with: + node-version: 20.x + - name: Build NapCat.Shell + run: | + npm i + npm run build:shell && npm run depend + rm package-lock.json + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: NapCat.Shell + path: dist