Skip to content

Commit ae7d9a4

Browse files
committed
跨平台自动化构建工作流测试
1 parent d9320a6 commit ae7d9a4

File tree

3 files changed

+98
-1
lines changed

3 files changed

+98
-1
lines changed

.github/workflows/build.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ${{ matrix.os }}
11+
12+
strategy:
13+
matrix:
14+
os: [macos-latest, windows-latest, ubuntu-latest]
15+
16+
steps:
17+
- name: Check out Git repository
18+
uses: actions/checkout@v4
19+
20+
- name: Install Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '22.17.0'
24+
25+
- name: Install Dependencies
26+
run: |
27+
npm install -g [email protected]
28+
pnpm install
29+
30+
# MacOS Build
31+
- name: Build MacOS
32+
if: matrix.os == 'macos-latest'
33+
run: |
34+
export ELECTRON_BUILDER_EXTRA_ARGS="--universal"
35+
pnpm run build
36+
env:
37+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
CSC_IDENTITY_AUTO_DISCOVERY: false
39+
DEBUG: electron-builder
40+
41+
# Windows Build
42+
- name: Build Windows
43+
if: matrix.os == 'windows-latest'
44+
run: pnpm run build
45+
env:
46+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
48+
# Linux Build
49+
- name: Build Linux
50+
if: matrix.os == 'ubuntu-latest'
51+
run: |
52+
sudo apt-get update
53+
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
54+
pnpm run build
55+
env:
56+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
58+
# Get version from tag
59+
- name: Get version from tag
60+
id: get_version
61+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
62+
shell: bash
63+
64+
# Read release notes
65+
- name: Read release notes
66+
id: release_notes
67+
run: |
68+
NOTES=$(awk "/## \[v${{ env.VERSION }}\]/{p=1;print;next} /## \[v/{p=0}p" CHANGELOG.md)
69+
echo "NOTES<<EOF" >> $GITHUB_ENV
70+
echo "$NOTES" >> $GITHUB_ENV
71+
echo "EOF" >> $GITHUB_ENV
72+
shell: bash
73+
74+
# Upload artifacts
75+
- name: Upload artifacts
76+
uses: softprops/action-gh-release@v1
77+
with:
78+
files: |
79+
dist/*.dmg
80+
dist/*.exe
81+
dist/*.deb
82+
dist/*.rpm
83+
dist/*.AppImage
84+
dist/latest*.yml
85+
dist/*.blockmap
86+
body: ${{ env.NOTES }}
87+
draft: false
88+
prerelease: false
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
此项目的所有显著更改都将记录在此文件中。
3+
4+
## [v0.7.1] - 2025-08-07
5+
### Added
6+
- 构建测试
7+
- 跨平台: macOS dmg, Windows exe, Linux deb/rpm/AppImage.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "short-video-factory",
33
"description": "短视频工厂,一键生成产品营销与泛内容短视频,AI批量自动剪辑",
4-
"version": "0.7.0",
4+
"version": "0.7.1",
55
"author": {
66
"name": "YILS",
77
"developer": "YILS",

0 commit comments

Comments
 (0)