-
Notifications
You must be signed in to change notification settings - Fork 191
132 lines (110 loc) · 3.73 KB
/
Copy pathrelease.yml
File metadata and controls
132 lines (110 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Build and Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
- os: macos-latest
platform: mac
- os: windows-latest
platform: win
- os: ubuntu-latest
platform: linux
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
# 显式使用与 package.json 中一致的 pnpm 版本
version: 9.15.0
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build for ${{ matrix.platform }}
run: pnpm electron:build:${{ matrix.platform }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Remove universal exe (keep only arch-specific)
if: matrix.platform == 'win'
shell: bash
run: |
# 删除通用 exe,只保留带架构标识的
find dist -name "*.exe" ! -name "*-x64.exe" ! -name "*-arm64.exe" -delete || true
- name: Remove debug files
shell: bash
run: |
# 删除 builder-debug.yml
find dist -name "builder-debug.yml" -delete || true
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-build
path: |
dist/*.dmg
dist/*.zip
dist/*-x64.exe
dist/*-arm64.exe
dist/*.AppImage
dist/*.deb
dist/*.blockmap
dist/latest*.yml
if-no-files-found: ignore
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: artifacts/**/*
draft: false
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }}
generate_release_notes: true
body: |
## 📦 下载安装
| 平台 | 芯片 | 下载文件示例 |
|------|------|--------------|
| macOS | Intel 芯片 | `PromptHub-x.x.x-x64.dmg` |
| macOS | M 系列芯片 | `PromptHub-x.x.x-arm64.dmg` |
| Windows | x64 | `PromptHub-Setup-x.x.x-x64.exe` |
| Linux | x64 | `PromptHub-x.x.x.AppImage` / `.deb` |
> 💡 实际文件名中的 `x.x.x` 会是本次发布的版本号,例如 `0.1.6`。
### ⚠️ macOS 首次启动
如果提示"无法打开"或"已损坏",请在终端执行:
```bash
sudo xattr -rd com.apple.quarantine /Applications/PromptHub.app
```
---
## 🔄 本次更新
详细更新日志请查看 [更新日志](https://github.com/legeling/PromptHub#-更新日志)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}