-
Notifications
You must be signed in to change notification settings - Fork 0
189 lines (165 loc) · 6.21 KB
/
tui-release.yml
File metadata and controls
189 lines (165 loc) · 6.21 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
name: tui-release
on:
push:
tags:
- "tui-v*"
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
build-binaries:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
asset_name: cable-intel-tui-linux-x64
exec_name: cable-intel-tui-linux-x64
- os: macos-14
asset_name: cable-intel-tui-macos-arm64
exec_name: cable-intel-tui-macos-arm64
- os: windows-latest
asset_name: blacksmith-4vcpu-windows-2025
exec_name: blacksmith-4vcpu-windows-2025
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.11
- name: Install dependencies (unix)
if: runner.os != 'Windows'
run: bun install --frozen-lockfile
shell: bash
- name: Build + smoke test (unix)
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
mkdir -p apps/tui/dist
bun build apps/tui/src/index.tsx --compile --outfile "apps/tui/dist/${{ matrix.exec_name }}"
"./apps/tui/dist/${{ matrix.exec_name }}" --help
shasum -a 256 "apps/tui/dist/${{ matrix.exec_name }}" > "apps/tui/dist/${{ matrix.exec_name }}.sha256"
- name: Install dependencies (windows)
if: runner.os == 'Windows'
shell: pwsh
run: bun install --frozen-lockfile
- name: Build + smoke test (windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path apps/tui/dist | Out-Null
bun build apps/tui/src/index.tsx --compile --outfile "apps/tui/dist/${{ matrix.exec_name }}"
& "apps/tui/dist/${{ matrix.exec_name }}" --help
$hash = (Get-FileHash -Path "apps/tui/dist/${{ matrix.exec_name }}" -Algorithm SHA256).Hash.ToLower()
"$hash *${{ matrix.exec_name }}" | Set-Content "apps/tui/dist/${{ matrix.exec_name }}.sha256"
- name: Upload binary artifact
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.asset_name }}
path: |
apps/tui/dist/${{ matrix.exec_name }}
apps/tui/dist/${{ matrix.exec_name }}.sha256
if-no-files-found: error
browser-qa:
runs-on: blacksmith-2vcpu-ubuntu-2404
env:
PUBLIC_CONVEX_URL: "https://example.convex.cloud"
BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }}
BROWSERBASE_PROJECT_ID: ${{ secrets.BROWSERBASE_PROJECT_ID }}
RELEASE_QA_TARGET_URL: ${{ vars.RELEASE_QA_TARGET_URL }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.11
- name: Cache Bun + Turbo
uses: actions/cache@v5
with:
path: |
~/.bun/install/cache
.turbo
key: ${{ runner.os }}-bun-turbo-${{ hashFiles('**/bun.lock', '**/bun.lockb', 'package.json', 'apps/**/package.json', 'packages/**/package.json') }}
restore-keys: |
${{ runner.os }}-bun-turbo-
- name: Cache Playwright browsers
uses: actions/cache@v5
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/bun.lock', '**/bun.lockb', 'package.json', 'apps/**/package.json', 'packages/**/package.json') }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Install agent-browser CLI
run: npm install -g agent-browser@latest
- name: Install Playwright Chromium (local provider)
run: npx playwright install --with-deps chromium
- name: Run browser QA smoke
run: |
if [ -z "${BROWSERBASE_API_KEY:-}" ]; then
echo "Missing required secret: BROWSERBASE_API_KEY" >&2
exit 1
fi
if [ -z "${BROWSERBASE_PROJECT_ID:-}" ]; then
echo "Missing required secret: BROWSERBASE_PROJECT_ID" >&2
exit 1
fi
if [ -z "${RELEASE_QA_TARGET_URL:-}" ]; then
echo "Missing required repository variable: RELEASE_QA_TARGET_URL" >&2
exit 1
fi
USE_BROWSERBASE=1 \
bash ./scripts/browser/run-local-browser-qa.sh \
--external-url "${RELEASE_QA_TARGET_URL}" \
--out-dir artifacts/browser-qa-release
- name: Upload browser QA artifact
uses: actions/upload-artifact@v7
with:
name: browser-qa-release
path: artifacts/browser-qa-release/**
if-no-files-found: error
publish-release:
if: startsWith(github.ref, 'refs/tags/')
needs:
- build-binaries
- browser-qa
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Download artifacts
uses: actions/download-artifact@v8
with:
path: release-assets
- name: Publish release assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
generate_release_notes: true
files: release-assets/**/*
- name: Append Browser QA replay link to release notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RESULTS_FILE="release-assets/browser-qa-release/results.json"
if [ ! -f "$RESULTS_FILE" ]; then
echo "No browser QA results file found; skipping release note append."
exit 0
fi
REPLAY_URL=$(jq -r '.browserbaseReplayUrl // empty' "$RESULTS_FILE")
if [ -z "$REPLAY_URL" ]; then
echo "No Browserbase replay URL found; skipping release note append."
exit 0
fi
CURRENT_BODY=$(gh release view "${GITHUB_REF_NAME}" --json body --jq '.body')
{
printf "%s\n\n" "$CURRENT_BODY"
echo "## Browser QA"
echo ""
echo "- Browserbase replay: ${REPLAY_URL}"
} > "$RUNNER_TEMP/release-notes.md"
gh release edit "${GITHUB_REF_NAME}" --notes-file "$RUNNER_TEMP/release-notes.md"