Skip to content

Commit 4ec9902

Browse files
committed
Merge branch 'ci/cd'
2 parents 85e3b50 + 0ebf84d commit 4ec9902

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/build-and-release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ jobs:
137137
uses: swatinem/rust-cache@v2
138138
with:
139139
workspaces: './src-tauri -> target'
140+
# 为self-hosted runner添加特定的cache key避免权限冲突
141+
key: ${{ matrix.platform }}-${{ hashFiles('**/Cargo.lock') }}
140142

141143
# Linux specific dependencies
142144
- name: Install Linux dependencies
@@ -216,6 +218,32 @@ jobs:
216218
echo "[ERROR] Could not find .app bundle"
217219
fi
218220
221+
# Fix file permissions before cache cleanup (macOS only)
222+
- name: Fix file permissions for cleanup
223+
if: matrix.platform == 'macos-arm64' && always()
224+
run: |
225+
echo "[INFO] Fixing file permissions for cleanup..."
226+
227+
# Reset ownership and permissions for target directory
228+
if [ -d "src-tauri/target" ]; then
229+
chown -R $(whoami):staff src-tauri/target || true
230+
chmod -R u+w src-tauri/target || true
231+
echo "[INFO] Fixed src-tauri/target permissions"
232+
fi
233+
234+
# Reset permissions for any Python related files created by uv
235+
if [ -d "$HOME/.local/share/uv" ]; then
236+
chown -R $(whoami):staff "$HOME/.local/share/uv" || true
237+
chmod -R u+w "$HOME/.local/share/uv" || true
238+
echo "[INFO] Fixed uv cache permissions"
239+
fi
240+
241+
# Reset permissions for any files created during build
242+
find . -type f -not -perm -u+w -exec chmod u+w {} \; 2>/dev/null || true
243+
find . -type d -not -perm -u+w -exec chmod u+w {} \; 2>/dev/null || true
244+
245+
echo "[INFO] File permissions cleanup completed"
246+
219247
# Create portable packages for Windows only
220248
- name: Create portable packages
221249
if: matrix.platform == 'windows-x64'

0 commit comments

Comments
 (0)