mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-03-22 03:43:10 +00:00
Compare commits
No commits in common. "43d1c72f8fe2bc538b786ca41ad5648c8ef57445" and "2b69e9dda5ec3c164cfb85f2a39a43a015c77d02" have entirely different histories.
43d1c72f8f
...
2b69e9dda5
109
.github/workflows/build-and-pr.yml
vendored
109
.github/workflows/build-and-pr.yml
vendored
@ -1,109 +0,0 @@
|
|||||||
name: Build and Create PR
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch: # 手动触发
|
|
||||||
push:
|
|
||||||
branches: [main, pr/*]
|
|
||||||
|
|
||||||
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@v4
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
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@v4
|
|
||||||
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@v4
|
|
||||||
|
|
||||||
- name: Download all artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: precompiled
|
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -R
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
|
|
||||||
- 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@v7
|
|
||||||
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}`);
|
|
||||||
@ -9,9 +9,9 @@
|
|||||||
"lint": "eslint \"**/*.{js,ts}\"",
|
"lint": "eslint \"**/*.{js,ts}\"",
|
||||||
"lint-fix": "eslint --fix \"**/*.{js,ts}\"",
|
"lint-fix": "eslint --fix \"**/*.{js,ts}\"",
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"pkgwin": "pkg . -t node18-win-x64 -C GZip -o precompiled/app",
|
"pkgwin": "pkg . -t node18-win-x64 -C GZip -o bin/app --no-bytecode",
|
||||||
"pkglinux": "pkg . -t node18-linux-x64 -C GZip -o precompiled/app",
|
"pkglinux": "pkg . -t node18-linux-x64 -C GZip -o bin/app --no-bytecode",
|
||||||
"pkgmacos": "pkg . -t node18-macos-x64 -C GZip -o precompiled/app"
|
"pkgmacos": "pkg . -t node18-macos-x64 -C GZip -o bin/app --no-bytecode"
|
||||||
},
|
},
|
||||||
"bin": "./app.js",
|
"bin": "./app.js",
|
||||||
"pkg": {
|
"pkg": {
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -166,4 +166,4 @@ class AdvancedClientSignGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = AdvancedClientSignGenerator
|
module.exports = AdvancedClientSignGenerator
|
||||||
Loading…
x
Reference in New Issue
Block a user