forked from redwoodjs/sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (80 loc) · 3.2 KB
/
windows-debug.yml
File metadata and controls
92 lines (80 loc) · 3.2 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
name: Windows Debug Session
on:
workflow_dispatch:
inputs:
cursorTunnelName:
description: "Optional Cursor tunnel name (<=20 chars); leave blank for random"
required: false
gitUserName:
description: "Git user name (from local config)"
required: false
gitUserEmail:
description: "Git user email (from local config)"
required: false
cloudflareAccountId:
description: "Cloudflare Account ID (from local env)"
required: false
cloudflareApiToken:
description: "Cloudflare API Token (from local env)"
required: false
jobs:
debug-session:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
shell: pwsh
run: |
corepack enable
pnpm install
- name: Download Cursor CLI (bash)
shell: bash
run: |
set -euo pipefail
mkdir -p "$GITHUB_WORKSPACE/.tmp/cursor_cli"
curl -Lk "https://api2.cursor.sh/updates/download-latest?os=cli-win32-x64" -o "$GITHUB_WORKSPACE/.tmp/cursor_cli/cursor_cli.tar.gz"
- name: Extract Cursor CLI
shell: pwsh
run: |
$CursorDir = "$env:GITHUB_WORKSPACE\.tmp\cursor_cli"
$CursorArchive = "$CursorDir\cursor_cli.tar.gz"
tar -xvf $CursorArchive -C $CursorDir | Out-Null
Write-Host "Cursor CLI extracted to $CursorDir"
- name: Download auto-commit script
shell: pwsh
run: |
$AdScriptPath = "$env:GITHUB_WORKSPACE\.tmp\bin\ad"
$AdScriptDir = Split-Path -Parent $AdScriptPath
if (-not (Test-Path $AdScriptDir)) {
New-Item -ItemType Directory -Path $AdScriptDir -Force | Out-Null
}
# Download from gist
$GistUrl = "https://gist.githubusercontent.com/justinvdm/fcd6da9d28057addd263214d90793137/raw/e7404b71a0a27b9538890a95dd7804b18ec10c5d/ad"
Invoke-WebRequest -Uri $GistUrl -OutFile $AdScriptPath
# Make executable (bash will handle this)
bash -c "chmod +x '$AdScriptPath'"
# Add to PATH for PowerShell
$env:Path += ";$AdScriptDir"
[Environment]::SetEnvironmentVariable("Path", $env:Path, [EnvironmentVariableTarget]::User)
Write-Host "ad script downloaded to: $AdScriptPath"
- name: Setup Auto-Run Scripts
shell: pwsh
run: |
$params = @{
CursorTunnelName = "${{ inputs.cursorTunnelName }}"
}
if ("${{ inputs.gitUserName }}" -ne "") {
$params.GitUserName = "${{ inputs.gitUserName }}"
}
if ("${{ inputs.gitUserEmail }}" -ne "") {
$params.GitUserEmail = "${{ inputs.gitUserEmail }}"
}
if ("${{ inputs.cloudflareAccountId }}" -ne "") {
$params.CloudflareAccountId = "${{ inputs.cloudflareAccountId }}"
}
if ("${{ inputs.cloudflareApiToken }}" -ne "") {
$params.CloudflareApiToken = "${{ inputs.cloudflareApiToken }}"
}
pwsh -File "$env:GITHUB_WORKSPACE/scripts/setup-windows-debug-env.ps1" @params
- name: Start Interactive Debug Session
uses: mxschmitt/action-tmate@v3