From e6c582d4a4adb4de990db975ed071b87be9412ac Mon Sep 17 00:00:00 2001 From: "Wesley F. Young" Date: Sat, 7 Sep 2024 11:25:50 +0800 Subject: [PATCH] fix: clone current branch instead of `main` --- .github/workflows/build.yml | 78 ++++++++-------- .github/workflows/release.yml | 162 +++++++++++++++++----------------- 2 files changed, 120 insertions(+), 120 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bedb58ed..c2c221c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,54 +8,54 @@ jobs: Build-LiteLoader: runs-on: ubuntu-latest steps: - - name: Clone Main Repository - uses: actions/checkout@v4 - with: + - name: Clone Repository + uses: actions/checkout@v4 + with: repository: 'NapNeko/NapCatQQ' submodules: true - ref: main + ref: ${{ github.ref }} 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: Use Node.js 20.X + uses: actions/setup-node@v4 + with: + node-version: 20.x + - name: Build NuCat Framework + run: | npm i npm run build:framework cd dist npm i --omit=dev 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 - 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 Repository + uses: actions/checkout@v4 + with: + repository: 'NapNeko/NapCatQQ' + submodules: true + ref: ${{ github.ref }} + 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 + 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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a266175..203860ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,107 +26,107 @@ jobs: node-version: 20.x - name: Check Version - run: | - ls - node ./script/checkVersion.cjs - sh ./checkVersion.sh + run: | + ls + node ./script/checkVersion.cjs + sh ./checkVersion.sh Build-LiteLoader: - needs: [check-version] + needs: [ check-version ] runs-on: ubuntu-latest steps: - - name: Clone Main Repository - uses: actions/checkout@v4 - with: + - 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: + - name: Use Node.js 20.X + uses: actions/setup-node@v4 + with: node-version: 20.x - - name: Build NuCat Framework - run: | + - name: Build NuCat Framework + run: | npm i npm run build:framework cd dist npm i --omit=dev 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 - needs: [check-version] + needs: [ check-version ] steps: - - name: Clone Main Repository - uses: actions/checkout@v4 - with: - repository: 'NapNeko/NapCatQQ' - submodules: true - ref: main - token: ${{ secrets.NAPCAT_BUILD }} + - 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 Shell - run: | - npm i - npm run build:shell - cd dist - npm i --omit=dev - cd .. + - name: Use Node.js 20.X + uses: actions/setup-node@v4 + with: + node-version: 20.x - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: NapCat.Shell - path: dist + - name: Build NuCat Shell + run: | + npm i + npm run build:shell + cd dist + npm i --omit=dev + cd .. + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: NapCat.Shell + path: dist release-napcat: - needs: [Build-LiteLoader,Build-Shell] + needs: [ Build-LiteLoader,Build-Shell ] runs-on: ubuntu-latest steps: - - name: Download All Artifact - uses: actions/download-artifact@v4 - # - name: Compress subdirectories - # run: | - # cd ./NapCat.Shell/ - # zip -q -r NapCat.Shell.zip * - # cd .. - # rm ./NapCat.Shell.zip -rf - # mv ./NapCat.Shell/NapCat.Shell.zip ./ - - name: Compress subdirectories - run: | - cd ./NapCat.Shell/ - zip -q -r NapCat.Shell.zip * - cd .. - cd ./NapCat.Framework/ - zip -q -r NapCat.Framework.zip * - cd .. - rm ./NapCat.Shell.zip -rf - rm ./NapCat.Framework.zip -rf - mv ./NapCat.Shell/NapCat.Shell.zip ./ - mv ./NapCat.Framework/NapCat.Framework.zip ./ - - name: Extract version from tag - run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV - - - name: Clone Changes Log - run: curl -o CHANGELOG.md https://fastly.jsdelivr.net/gh/NapNeko/NapCatQQ@main/docs/changelogs/CHANGELOG.v${{ env.VERSION }}.md - - - name: Create Release Draft and Upload Artifacts - uses: softprops/action-gh-release@v1 - with: - name: NapCat V${{ env.VERSION }} - token: ${{ secrets.GITHUB_TOKEN }} - body_path: CHANGELOG.md - files: | - NapCat.Framework.zip - NapCat.Shell.zip - draft: true + - name: Download All Artifact + uses: actions/download-artifact@v4 + # - name: Compress subdirectories + # run: | + # cd ./NapCat.Shell/ + # zip -q -r NapCat.Shell.zip * + # cd .. + # rm ./NapCat.Shell.zip -rf + # mv ./NapCat.Shell/NapCat.Shell.zip ./ + - name: Compress subdirectories + run: | + cd ./NapCat.Shell/ + zip -q -r NapCat.Shell.zip * + cd .. + cd ./NapCat.Framework/ + zip -q -r NapCat.Framework.zip * + cd .. + rm ./NapCat.Shell.zip -rf + rm ./NapCat.Framework.zip -rf + mv ./NapCat.Shell/NapCat.Shell.zip ./ + mv ./NapCat.Framework/NapCat.Framework.zip ./ + - name: Extract version from tag + run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV + + - name: Clone Changes Log + run: curl -o CHANGELOG.md https://fastly.jsdelivr.net/gh/NapNeko/NapCatQQ@main/docs/changelogs/CHANGELOG.v${{ env.VERSION }}.md + + - name: Create Release Draft and Upload Artifacts + uses: softprops/action-gh-release@v1 + with: + name: NapCat V${{ env.VERSION }} + token: ${{ secrets.GITHUB_TOKEN }} + body_path: CHANGELOG.md + files: | + NapCat.Framework.zip + NapCat.Shell.zip + draft: true