diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0345676d..73bef54c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,11 +8,7 @@ on: jobs: validate: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - name: Checkout @@ -36,8 +32,31 @@ jobs: - name: Lint run: pnpm lint - - name: Test - run: pnpm test - - name: Build run: pnpm build + + test: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + + - name: Install dependencies + run: pnpm install --no-frozen-lockfile + + - name: Test + run: pnpm test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a863dee..aef5e755 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,19 +31,13 @@ jobs: - name: Package macOS env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} CSC_LINK: ${{ secrets.MAC_CERTS }} CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - run: pnpm dist:mac - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: release-macos - path: release/** - if-no-files-found: error + run: pnpm dist:mac --publish always package-win: runs-on: windows-latest @@ -68,11 +62,6 @@ jobs: run: pnpm build - name: Package Windows - run: pnpm dist:win - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: release-windows - path: release/** - if-no-files-found: error + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: pnpm dist:win --publish always diff --git a/src/main/utils/metadataExtraction.ts b/src/main/utils/metadataExtraction.ts index 41a24dec..720204ac 100644 --- a/src/main/utils/metadataExtraction.ts +++ b/src/main/utils/metadataExtraction.ts @@ -32,12 +32,16 @@ export async function extractCwd(filePath: string): Promise { const entry = JSON.parse(line) as ChatHistoryEntry; // Only conversational entries have cwd if ('cwd' in entry && entry.cwd) { + rl.close(); fileStream.destroy(); return entry.cwd; } } } catch (error) { logger.error(`Error extracting cwd from ${filePath}:`, error); + } finally { + rl.close(); + fileStream.destroy(); } return null; diff --git a/test/main/services/discovery/ProjectPathResolver.test.ts b/test/main/services/discovery/ProjectPathResolver.test.ts index 085b07cb..bad18ed2 100644 --- a/test/main/services/discovery/ProjectPathResolver.test.ts +++ b/test/main/services/discovery/ProjectPathResolver.test.ts @@ -18,9 +18,15 @@ function createSessionLine(cwd: string): string { describe('ProjectPathResolver', () => { const tempDirs: string[] = []; - afterEach(() => { + afterEach(async () => { + // Allow Windows file handles from readline/streams to be released + await new Promise((resolve) => setTimeout(resolve, 50)); for (const tempDir of tempDirs) { - fs.rmSync(tempDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }); + try { + fs.rmSync(tempDir, { recursive: true, force: true, maxRetries: 5, retryDelay: 200 }); + } catch { + // Ignore cleanup failures to prevent cascading test errors on Windows + } } tempDirs.length = 0; });