🐳 chore: 修复构建

This commit is contained in:
imsyy
2025-10-17 00:11:01 +08:00
parent 87ce076f26
commit aec06c5a55
3 changed files with 113 additions and 111 deletions

View File

@@ -1,6 +1,5 @@
# Release 发行版本部署
## 多端部署,支持 x64 和 ARM64 架构
name: Build Release
## 多平台构建并统一上传
on:
push:
@@ -8,24 +7,25 @@ on:
- v*
workflow_dispatch:
name: Build Release
jobs:
# Windows x64 架构
build-windows-x64:
name: Build for Windows (x64)
runs-on: windows-latest
steps:
# 检出 Git 仓库
- name: Check out git repository
uses: actions/checkout@v4
# 安装 Node.js
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
# 安装 pnpm
- name: Install pnpm
run: npm install -g pnpm
# 复制环境变量文件
- name: Copy .env.example
run: |
if (-not (Test-Path .env)) {
@@ -33,21 +33,21 @@ jobs:
} else {
Write-Host ".env file already exists. Skipping the copy step."
}
# 安装项目依赖
- name: Install Dependencies
run: pnpm install
# 清理旧的构建产物
- name: Clean dist folder
run: |
if (Test-Path dist) {
Remove-Item -Recurse -Force dist
}
# 构建 Electron App (x64)
- name: Build Electron App for Windows x64
run: pnpm run build:win -- --x64 || true
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# 上传构建产物
- name: Upload Windows x64 artifact
uses: actions/upload-artifact@v4
with:
@@ -57,34 +57,23 @@ jobs:
dist/*.exe
dist/*.exe.blockmap
dist/*.yml
# 创建 GitHub Release
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
files: |
dist/*.exe
dist/*.exe.blockmap
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
dist/*.*
# Windows ARM64 架构
build-windows-arm64:
name: Build for Windows (ARM64)
runs-on: windows-11-arm
steps:
# 检出 Git 仓库
- name: Check out git repository
uses: actions/checkout@v4
# 安装 Node.js
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
# 安装 pnpm
- name: Install pnpm
run: npm install -g pnpm
# 复制环境变量文件
- name: Copy .env.example
run: |
if (-not (Test-Path .env)) {
@@ -92,21 +81,21 @@ jobs:
} else {
Write-Host ".env file already exists. Skipping the copy step."
}
# 安装项目依赖
- name: Install Dependencies
run: pnpm install
# 清理旧的构建产物
- name: Clean dist folder
run: |
if (Test-Path dist) {
Remove-Item -Recurse -Force dist
}
# 构建 Electron App (ARM64)
- name: Build Electron App for Windows ARM64
run: pnpm run build:win -- --arm64 || true
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# 上传构建产物
- name: Upload Windows ARM64 artifact
uses: actions/upload-artifact@v4
with:
@@ -116,33 +105,23 @@ jobs:
dist/*.exe
dist/*.exe.blockmap
dist/*.yml
# 创建 GitHub Release
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
files: |
dist/*.exe
dist/*.exe.blockmap
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# macOS - 分别构建 x64 和 ARM64
dist/*.*
# macOS - Intel x64
build-macos-x64:
name: Build for macOS (Intel x64)
runs-on: macos-13
steps:
# 检出 Git 仓库
- name: Check out git repository
uses: actions/checkout@v4
# 安装 Node.js
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
# 安装 pnpm
- name: Install pnpm
run: npm install -g pnpm
# 复制环境变量文件
- name: Copy .env.example
run: |
if [ ! -f .env ]; then
@@ -150,19 +129,19 @@ jobs:
else
echo ".env file already exists. Skipping the copy step."
fi
# 安装项目依赖
- name: Install Dependencies
run: pnpm install
# 清理旧的构建产物
- name: Clean dist folder
run: rm -rf dist
# 构建 Electron App (x64)
- name: Build Electron App for macOS x64
run: pnpm run build:mac -- --x64 || true
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# 上传构建产物
- name: Upload macOS x64 artifact
uses: actions/upload-artifact@v4
with:
@@ -171,31 +150,22 @@ jobs:
path: |
dist/*.*
dist/*.yml
# 创建 GitHub Release
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
files: dist/*.*
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# macOS - Apple Silicon ARM64
build-macos-arm64:
name: Build for macOS (Apple Silicon ARM64)
runs-on: macos-15
steps:
# 检出 Git 仓库
- name: Check out git repository
uses: actions/checkout@v4
# 安装 Node.js
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
# 安装 pnpm
- name: Install pnpm
run: npm install -g pnpm
# 复制环境变量文件
- name: Copy .env.example
run: |
if [ ! -f .env ]; then
@@ -203,19 +173,19 @@ jobs:
else
echo ".env file already exists. Skipping the copy step."
fi
# 安装项目依赖
- name: Install Dependencies
run: pnpm install
# 清理旧的构建产物
- name: Clean dist folder
run: rm -rf dist
# 构建 Electron App (ARM64)
- name: Build Electron App for macOS ARM64
run: pnpm run build:mac -- --arm64 || true
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# 上传构建产物
- name: Upload macOS ARM64 artifact
uses: actions/upload-artifact@v4
with:
@@ -224,45 +194,36 @@ jobs:
path: |
dist/*.*
dist/*.yml
# 创建 GitHub Release
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
files: dist/*.*
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# Linux x64 架构
build-linux-x64:
name: Build for Linux (x64)
runs-on: ubuntu-22.04
steps:
# 检出 Git 仓库
- name: Check out git repository
uses: actions/checkout@v4
# 安装 Node.js
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
# 安装 pnpm
- name: Install pnpm
run: npm install -g pnpm
# 更新 Ubuntu 软件源
- name: Ubuntu Update with sudo
run: sudo apt-get update
# 安装依赖
- name: Install RPM & Pacman
run: |
sudo apt-get install --no-install-recommends -y rpm &&
sudo apt-get install --no-install-recommends -y libarchive-tools &&
sudo apt-get install --no-install-recommends -y libopenjp2-tools
# 安装 Snapcraft
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v2
with:
snapcraft_token: ${{ secrets.SNAPCRAFT_TOKEN }}
# 复制环境变量文件
- name: Copy .env.example
run: |
if [ ! -f .env ]; then
@@ -270,29 +231,29 @@ jobs:
else
echo ".env file already exists. Skipping the copy step."
fi
# 安装项目依赖
- name: Install Dependencies
run: pnpm install
# 清理旧的构建产物
- name: Clean dist folder
run: rm -rf dist
# 构建 Electron App (x64)
- name: Build Electron App for Linux x64
run: pnpm run build:linux -- --x64 || true
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
# 上传 Snap 包到 Snapcraft 商店
- name: Publish Snap to Snap Store
run: |
if [ -f dist/*.snap ]; then
if compgen -G "dist/*.snap" > /dev/null; then
snapcraft upload dist/*.snap --release stable || echo "Snap upload failed or not configured"
fi
continue-on-error: true
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
# 上传构建产物
- name: Upload Linux x64 artifact
uses: actions/upload-artifact@v4
with:
@@ -301,41 +262,31 @@ jobs:
path: |
dist/*.*
dist/*.yml
# 创建 GitHub Release
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
files: dist/*.*
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# Linux ARM64 架构
build-linux-arm64:
name: Build for Linux (ARM64)
runs-on: ubuntu-22.04-arm
steps:
# 检出 Git 仓库
- name: Check out git repository
uses: actions/checkout@v4
# 安装 Node.js
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
# 安装 pnpm
- name: Install pnpm
run: npm install -g pnpm
# 更新 Ubuntu 软件源
- name: Ubuntu Update with sudo
run: sudo apt-get update
# 安装依赖
- name: Install Build Dependencies
run: |
sudo apt-get install --no-install-recommends -y rpm &&
sudo apt-get install --no-install-recommends -y libarchive-tools &&
sudo apt-get install --no-install-recommends -y libopenjp2-tools
# 复制环境变量文件
- name: Copy .env.example
run: |
if [ ! -f .env ]; then
@@ -343,19 +294,19 @@ jobs:
else
echo ".env file already exists. Skipping the copy step."
fi
# 安装项目依赖
- name: Install Dependencies
run: pnpm install
# 清理旧的构建产物
- name: Clean dist folder
run: rm -rf dist
# 构建 Electron App (ARM64)
- name: Build Electron App for Linux ARM64
run: pnpm run build:linux -- --arm64 || true
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# 上传构建产物
- name: Upload Linux ARM64 artifact
uses: actions/upload-artifact@v4
with:
@@ -364,11 +315,61 @@ jobs:
path: |
dist/*.*
dist/*.yml
# 创建 GitHub Release
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
# 汇总并创建 Release仅在 tag v* 时运行)
create-release:
name: Create GitHub Release and upload assets
runs-on: ubuntu-latest
needs:
- build-windows-x64
- build-windows-arm64
- build-macos-x64
- build-macos-arm64
- build-linux-x64
- build-linux-arm64
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Check out repo (for context)
uses: actions/checkout@v4
- name: Download Windows x64 artifact (if exists)
uses: actions/download-artifact@v4
with:
files: dist/*.*
name: SPlayer-Win-x64
path: artifacts/SPlayer-Win-x64
- name: Download Windows ARM64 artifact (if exists)
uses: actions/download-artifact@v4
with:
name: SPlayer-Win-ARM64
path: artifacts/SPlayer-Win-ARM64
- name: Download macOS x64 artifact (if exists)
uses: actions/download-artifact@v4
with:
name: SPlayer-macOS-x64
path: artifacts/SPlayer-macOS-x64
- name: Download macOS ARM64 artifact (if exists)
uses: actions/download-artifact@v4
with:
name: SPlayer-macOS-ARM64
path: artifacts/SPlayer-macOS-ARM64
- name: Download Linux x64 artifact (if exists)
uses: actions/download-artifact@v4
with:
name: SPlayer-Linux-x64
path: artifacts/SPlayer-Linux-x64
- name: Download Linux ARM64 artifact (if exists)
uses: actions/download-artifact@v4
with:
name: SPlayer-Linux-ARM64
path: artifacts/SPlayer-Linux-ARM64
- name: List downloaded artifacts
run: ls -R artifacts || true
- name: Create GitHub Release and upload assets (all artifacts & yml)
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/**
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

2
components.d.ts vendored
View File

@@ -92,9 +92,11 @@ declare module 'vue' {
NOl: typeof import('naive-ui')['NOl']
NP: typeof import('naive-ui')['NP']
NPopover: typeof import('naive-ui')['NPopover']
NProgress: typeof import('naive-ui')['NProgress']
NQrCode: typeof import('naive-ui')['NQrCode']
NRadio: typeof import('naive-ui')['NRadio']
NRadioGroup: typeof import('naive-ui')['NRadioGroup']
NResult: typeof import('naive-ui')['NResult']
NScrollbar: typeof import('naive-ui')['NScrollbar']
NSelect: typeof import('naive-ui')['NSelect']
NSkeleton: typeof import('naive-ui')['NSkeleton']

View File

@@ -141,4 +141,3 @@ publish:
# url: https://example.com/auto-updates
owner: "imsyy"
repo: "SPlayer"
publishAutoUpdate: false