Repository navigation
201 lines (189 loc) · 8.29 KB
/
Copy pathrelease.yml
File metadata and controls
201 lines (189 loc) · 8.29 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
name: Release
on:
push:
tags: ["v*"]
permissions:
contents: write
jobs:
windows:
name: Windows x64 portable
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: . -> target
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: apps/desktop/package-lock.json
- name: Install frontend dependencies
working-directory: apps/desktop
run: npm ci
- name: Build and stage embedded Hook
shell: pwsh
run: |
cargo build --release -p codex-notify-hook
$triple = rustc --print host-tuple
New-Item -ItemType Directory -Force apps/desktop/src-tauri/binaries | Out-Null
Copy-Item target/release/codex-notify-hook.exe "apps/desktop/src-tauri/binaries/codex-notify-hook-$triple.exe"
- name: Build portable executable
working-directory: apps/desktop
run: npx tauri build --no-bundle
- name: Collect release file
shell: pwsh
run: |
New-Item -ItemType Directory -Force release-assets | Out-Null
Copy-Item target/release/codex-notify-desktop.exe release-assets/CodexNotify-Windows-x64.exe
- uses: actions/upload-artifact@v4
with:
name: release-windows
path: release-assets/CodexNotify-Windows-x64.exe
if-no-files-found: error
macos:
name: macOS universal DMG
runs-on: macos-14
env:
# Ad-hoc signing keeps Apple Silicon bundles internally consistent. Add Apple Developer
# certificate/notarization secrets later to remove the Gatekeeper review prompt.
APPLE_SIGNING_IDENTITY: "-"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin,x86_64-apple-darwin
- uses: Swatinem/rust-cache@v2
with:
workspaces: . -> target
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: apps/desktop/package-lock.json
- name: Install frontend dependencies
working-directory: apps/desktop
run: npm ci
- name: Build architecture-specific embedded Hooks
run: |
cargo build --release -p codex-notify-hook --target aarch64-apple-darwin
cargo build --release -p codex-notify-hook --target x86_64-apple-darwin
mkdir -p apps/desktop/src-tauri/binaries
cp target/aarch64-apple-darwin/release/codex-notify-hook apps/desktop/src-tauri/binaries/codex-notify-hook-aarch64-apple-darwin
cp target/x86_64-apple-darwin/release/codex-notify-hook apps/desktop/src-tauri/binaries/codex-notify-hook-x86_64-apple-darwin
- name: Build universal DMG
working-directory: apps/desktop
run: npx tauri build --target universal-apple-darwin --bundles dmg
- name: Collect release file
run: |
mkdir -p release-assets
cp target/universal-apple-darwin/release/bundle/dmg/*.dmg release-assets/CodexNotify-macOS-Universal.dmg
- uses: actions/upload-artifact@v4
with:
name: release-macos
path: release-assets/CodexNotify-macOS-Universal.dmg
if-no-files-found: error
linux-desktop:
name: Linux desktop AppImage
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: . -> target
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: apps/desktop/package-lock.json
- name: Install Linux desktop dependencies
run: sudo apt-get update && sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf pkg-config
- name: Install frontend dependencies
working-directory: apps/desktop
run: npm ci
- name: Build and stage embedded Hook
run: |
cargo build --release -p codex-notify-hook
mkdir -p apps/desktop/src-tauri/binaries
cp target/release/codex-notify-hook apps/desktop/src-tauri/binaries/codex-notify-hook-x86_64-unknown-linux-gnu
- name: Build AppImage
working-directory: apps/desktop
run: npx tauri build --bundles appimage
- name: Collect release file
run: |
mkdir -p release-assets
cp target/release/bundle/appimage/*.AppImage release-assets/CodexNotify-Linux-Desktop-x86_64.AppImage
- uses: actions/upload-artifact@v4
with:
name: release-linux-desktop
path: release-assets/CodexNotify-Linux-Desktop-x86_64.AppImage
if-no-files-found: error
linux-cli:
name: Linux CLI static x64
runs-on: ubuntu-22.04
env:
CC_x86_64_unknown_linux_musl: musl-gcc
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER: rust-lld
RUSTFLAGS: -C target-feature=+crt-static
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-musl
- uses: Swatinem/rust-cache@v2
with:
workspaces: . -> target
- name: Install musl toolchain
run: sudo apt-get update && sudo apt-get install -y musl-tools
- name: Build static Headless CLI
run: cargo build --release -p codex-notify-cli --target x86_64-unknown-linux-musl
- name: Verify static binary and collect release file
run: |
file target/x86_64-unknown-linux-musl/release/codex-notify
if readelf -l target/x86_64-unknown-linux-musl/release/codex-notify | grep -q 'Requesting program interpreter'; then
echo "Headless CLI unexpectedly requires a dynamic loader"
exit 1
fi
target/x86_64-unknown-linux-musl/release/codex-notify --version
mkdir -p release-assets
cp target/x86_64-unknown-linux-musl/release/codex-notify release-assets/codex-notify-Linux-CLI-x86_64
- uses: actions/upload-artifact@v4
with:
name: release-linux-cli
path: release-assets/codex-notify-Linux-CLI-x86_64
if-no-files-found: error
publish:
name: Publish one GitHub Release
needs: [windows, macos, linux-desktop, linux-cli]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: release-*
path: release-assets
merge-multiple: true
- name: Verify exactly four products
run: |
test "$(find release-assets -maxdepth 1 -type f | wc -l)" -eq 4
test -f release-assets/CodexNotify-macOS-Universal.dmg
test -f release-assets/CodexNotify-Windows-x64.exe
test -f release-assets/CodexNotify-Linux-Desktop-x86_64.AppImage
test -f release-assets/codex-notify-Linux-CLI-x86_64
- uses: softprops/action-gh-release@v2
with:
name: CodexNotify ${{ github.ref_name }}
body: |
## 下载 / Downloads
- **Windows 10/11 x64 免安装版:** `CodexNotify-Windows-x64.exe`
- **macOS Intel + Apple Silicon:** `CodexNotify-macOS-Universal.dmg`
- **Linux 桌面 x86_64:** `CodexNotify-Linux-Desktop-x86_64.AppImage`
- **Linux 无桌面 x86_64:** `codex-notify-Linux-CLI-x86_64`
Linux CLI 只需下载单文件并设置 `CODEX_NOTIFY_BARK_KEY`,然后运行 `codex-notify init && codex-notify hook install`。
使用说明:[中文文档](https://github.com/${{ github.repository }}/blob/${{ github.ref_name }}/README.md) · [English documentation](https://github.com/${{ github.repository }}/blob/${{ github.ref_name }}/README_EN.md)
Windows 与 macOS 版本目前没有商业代码签名,首次启动时系统可能要求额外确认。Linux 文件下载后可能需要先执行 `chmod +x <文件名>`。
Windows and macOS builds are currently unsigned with commercial certificates, so the operating system may request a one-time confirmation. Linux downloads may require `chmod +x <filename>` before first launch.
generate_release_notes: true
files: release-assets/*
fail_on_unmatched_files: true