From 4195c4117182873ae16f896ccc55c8977eabbc4d Mon Sep 17 00:00:00 2001 From: MoeFurina Date: Fri, 29 May 2026 21:49:21 +0800 Subject: [PATCH] bump 4.33.1 --- .github/workflows/Build_Image.yml | 54 --------- .github/workflows/build-and-pr.yml | 109 ------------------ .github/workflows/build-dev.yml | 53 +++++++++ .github/workflows/npm.yml | 25 ---- .../workflows/release-on-version-change.yml | 81 ++++++++++++- package.json | 2 +- 6 files changed, 134 insertions(+), 190 deletions(-) delete mode 100644 .github/workflows/Build_Image.yml delete mode 100644 .github/workflows/build-and-pr.yml create mode 100644 .github/workflows/build-dev.yml delete mode 100644 .github/workflows/npm.yml diff --git a/.github/workflows/Build_Image.yml b/.github/workflows/Build_Image.yml deleted file mode 100644 index 25cb958..0000000 --- a/.github/workflows/Build_Image.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Publish Docker image - -on: - release: - types: [published] - workflow_dispatch: - -permissions: - contents: read - packages: write - -jobs: - build-and-push: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - # 读取 package.json 的版本号 - - name: Read package version - id: pkg - run: echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push Docker image - uses: docker/build-push-action@v7 - with: - context: . - push: true - tags: | - moefurina/ncm-api:latest - moefurina/ncm-api:${{ env.VERSION }} - ghcr.io/neteasecloudmusicapienhanced/ncm-api:latest - ghcr.io/neteasecloudmusicapienhanced/ncm-api:${{ env.VERSION }} - platforms: linux/amd64,linux/arm64/v8 diff --git a/.github/workflows/build-and-pr.yml b/.github/workflows/build-and-pr.yml deleted file mode 100644 index 9e61945..0000000 --- a/.github/workflows/build-and-pr.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: Build and Create PR - -on: - workflow_dispatch: # 手动触发 - push: - branches: [main] - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - include: - - os: ubuntu-latest - platform: linux - target: node18-linux-x64 - output: precompiled/app - - os: windows-latest - platform: win - target: node18-win-x64 - output: precompiled/app.exe - - os: macos-latest - platform: macos - target: node18-macos-x64 - output: precompiled/app - - steps: - - name: Checkout code - uses: actions/checkout@v6 - - - name: Setup Node.js - uses: actions/setup-node@v6 - with: - node-version: '18' - - - name: Install dependencies - run: | - npm install -g pnpm - pnpm install - - - name: Build for ${{ matrix.platform }} - run: | - npm run pkg${{ matrix.platform }} - env: - PKG_TARGET: ${{ matrix.target }} - - - name: Upload artifacts - uses: actions/upload-artifact@v7 - with: - name: app-${{ matrix.platform }} - path: ${{ matrix.output }} - if-no-files-found: error - - create-pr: - needs: build - runs-on: ubuntu-latest - if: github.event_name == 'workflow_dispatch' # 只在手动触发时创建PR - - steps: - - name: Checkout code - uses: actions/checkout@v6 - - - name: Download all artifacts - uses: actions/download-artifact@v8 - with: - path: precompiled - - - name: Display structure of downloaded files - run: ls -R - - - name: Setup Node.js - uses: actions/setup-node@v6 - - - name: Create new branch and commit - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - - BRANCH_NAME="auto-build-$(date +%Y%m%d-%H%M%S)" - echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV - git checkout -b $BRANCH_NAME - - # 复制并整理下载的文件 - mkdir -p precompiled - cp app-win/* precompiled/ || true - cp app-linux/* precompiled/ || true - cp app-macos/* precompiled/ || true - - # 提交更改 - git add precompiled/ - git commit -m "Auto-build: Add compiled binaries for win, linux, macos" || exit 0 - - # 推送到远程仓库 - git push origin $BRANCH_NAME - - - name: Create Pull Request - uses: actions/github-script@v8 - with: - script: | - const { data: pullRequest } = await github.rest.pulls.create({ - owner: context.repo.owner, - repo: context.repo.repo, - title: 'Auto-build: Add compiled binaries for win, linux, macos', - head: '${{ env.BRANCH_NAME }}', - base: 'main', - body: 'This PR contains newly built binaries for Windows, Linux, and macOS platforms.' - }); - console.log(`Created PR #${pullRequest.number}: ${pullRequest.html_url}`); diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml new file mode 100644 index 0000000..f57f971 --- /dev/null +++ b/.github/workflows/build-dev.yml @@ -0,0 +1,53 @@ +name: Build Artifacts + +on: + workflow_dispatch: # 手动触发 + push: + branches: [main] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + include: + - os: ubuntu-latest + platform: linux + target: node18-linux-x64 + output: precompiled/app + - os: windows-latest + platform: win + target: node18-win-x64 + output: precompiled/app.exe + - os: macos-latest + platform: macos + target: node18-macos-x64 + output: precompiled/app + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version: '18' + + - name: Install dependencies + run: | + npm install -g pnpm + pnpm install + + - name: Build for ${{ matrix.platform }} + run: | + npm run pkg${{ matrix.platform }} + env: + PKG_TARGET: ${{ matrix.target }} + + - name: Upload artifacts + uses: actions/upload-artifact@v7 + with: + name: app-${{ matrix.platform }} + path: ${{ matrix.output }} + if-no-files-found: error \ No newline at end of file diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml deleted file mode 100644 index 7376d35..0000000 --- a/.github/workflows/npm.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Release - -on: - release: - types: [published] - -permissions: - contents: read - id-token: write - -jobs: - publish: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - - uses: actions/setup-node@v6 - with: - node-version: 24 - cache: npm - - - run: npm ci - - - run: npm publish --access public \ No newline at end of file diff --git a/.github/workflows/release-on-version-change.yml b/.github/workflows/release-on-version-change.yml index 9df98f1..e849d84 100644 --- a/.github/workflows/release-on-version-change.yml +++ b/.github/workflows/release-on-version-change.yml @@ -230,4 +230,83 @@ jobs: body_path: release-notes.md files: final-artifacts/* draft: false - prerelease: false \ No newline at end of file + prerelease: false + + publish-docker: + name: Publish Docker Image + needs: detect + + if: | + needs.detect.outputs.should_release == 'true' && + needs.detect.outputs.tag_exists != 'true' + + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Read package version + id: pkg + run: echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v7 + with: + context: . + push: true + tags: | + moefurina/ncm-api:latest + moefurina/ncm-api:${{ env.VERSION }} + ghcr.io/neteasecloudmusicapienhanced/ncm-api:latest + ghcr.io/neteasecloudmusicapienhanced/ncm-api:${{ env.VERSION }} + platforms: linux/amd64,linux/arm64/v8 + + publish-npm: + name: Publish to npm + needs: detect + + if: | + needs.detect.outputs.should_release == 'true' && + needs.detect.outputs.tag_exists != 'true' + + runs-on: ubuntu-latest + + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-node@v6 + with: + node-version: 24 + cache: npm + + - run: npm ci + + - run: npm publish --access public \ No newline at end of file diff --git a/package.json b/package.json index 6072c85..5bae4a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@neteasecloudmusicapienhanced/api", - "version": "4.33.0", + "version": "4.33.1", "description": "全网最全的网易云音乐API接口 || A revival project for NeteaseCloudMusicApi Node.js Services (Half Refactor & Enhanced) || 网易云音乐 API 备份 + 增强 || 本项目自原版v4.28.0版本后开始自行维护", "scripts": { "dev": "nodemon app.js",