mirror of
https://github.com/lqtmcstudio/QZMusic_PC.git
synced 2026-08-18 15:33:27 +08:00
feat: 实现收藏歌单、修复TopBar拖拽穿透问题、适配Linux amd64
This commit is contained in:
126
.github/workflows/build.yml
vendored
Normal file
126
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
# QZMusic 自动构建工作流
|
||||
#
|
||||
# 触发方式:
|
||||
# - push 到 master
|
||||
# - 推送到 v* tag (会自动创建 GitHub Release 并附上安装包)
|
||||
# - 手动触发 (workflow_dispatch)
|
||||
#
|
||||
# 产物:
|
||||
# - Linux (amd64): AppImage + deb
|
||||
# - Windows (x64): NSIS 安装包
|
||||
#
|
||||
# 注意: 请在提交前确保以下二进制已纳入 git 版本库 (否则 CI 拉不到):
|
||||
# core/qzplayer (Linux 播放核心, ELF)
|
||||
# core/libfftw3f.so.3 (FFTW 单精度运行库)
|
||||
# core/qzplayer.exe (Windows 播放核心)
|
||||
# core/libfftw3f-3.dll (Windows FFTW)
|
||||
# native/taglib_reader/build/taglib_reader_cli.exe (Windows 标签扫描器)
|
||||
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
tags: ['v*']
|
||||
pull_request:
|
||||
branches: [master]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
name: Linux (amd64)
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: Install TagLib (build taglib_reader)
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libtag1-dev
|
||||
|
||||
- name: Build taglib_reader (local music scanner)
|
||||
run: bash native/taglib_reader/build.sh
|
||||
|
||||
- name: Ensure native binaries are executable
|
||||
run: |
|
||||
chmod +x core/qzplayer
|
||||
chmod +x native/taglib_reader/build/taglib_reader_cli
|
||||
|
||||
- name: Build Linux packages
|
||||
run: bun run electron:build:linux
|
||||
env:
|
||||
CSC_IDENTITY_AUTO_DISCOVERY: "false"
|
||||
|
||||
- name: Upload Linux artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: qzmusic-linux-amd64
|
||||
path: |
|
||||
release/*.AppImage
|
||||
release/*.deb
|
||||
if-no-files-found: error
|
||||
|
||||
build-windows:
|
||||
name: Windows (x64)
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: Build Windows installer
|
||||
run: bun run electron:build
|
||||
env:
|
||||
CSC_IDENTITY_AUTO_DISCOVERY: "false"
|
||||
|
||||
- name: Upload Windows artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: qzmusic-windows-x64
|
||||
path: |
|
||||
release/*.exe
|
||||
release/*.blockmap
|
||||
if-no-files-found: error
|
||||
|
||||
release:
|
||||
name: Create GitHub Release
|
||||
needs: [build-linux, build-windows]
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: artifacts
|
||||
merge-multiple: true
|
||||
|
||||
- name: Publish release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: artifacts/*
|
||||
generate_release_notes: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user