Skip to content

Commit 88d68c1

Browse files
authored
Development (#2)
* feat: Implement initial TestPilot browser extension with session management, issue detection, and popup UI. * feat: establish core browser extension with session management, issue monitoring, and reporting features via a new popup UI. * ci: Add GitHub Actions workflow to build and release the extension.
1 parent 2065725 commit 88d68c1

File tree

1 file changed

+65
-19
lines changed

1 file changed

+65
-19
lines changed

.github/workflows/build.yml

Lines changed: 65 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build & Lint Extension
1+
name: Build & Release Extension
22

33
on:
44
push:
@@ -9,28 +9,74 @@ on:
99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write # needed to create releases and upload assets
1214

1315
steps:
14-
- uses: actions/checkout@v4
16+
- name: Checkout code
17+
uses: actions/checkout@v4
1518

16-
- name: Use Node.js 20
17-
uses: actions/setup-node@v4
18-
with:
19-
node-version: 20
20-
cache: 'npm'
19+
- name: Set up Node.js 20
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
cache: 'npm'
2124

22-
- name: Install dependencies
23-
run: npm ci
25+
- name: Install dependencies
26+
run: npm ci
2427

25-
- name: Type Check
26-
run: npm run type-check
28+
- name: Type check
29+
run: npm run type-check
2730

28-
- name: Build Extension
29-
run: npm run build
31+
- name: Build extension
32+
run: npm run build
3033

31-
- name: Upload Build Artifact
32-
uses: actions/upload-artifact@v4
33-
with:
34-
name: testpilot-extension
35-
path: dist/
36-
retention-days: 5
34+
# ── Build info ──────────────────────────────────────────────────────────
35+
- name: Generate build info
36+
id: build_info
37+
run: |
38+
SHA_SHORT=$(git rev-parse --short HEAD)
39+
DATE=$(date -u +"%Y-%m-%d")
40+
echo "sha_short=$SHA_SHORT" >> $GITHUB_OUTPUT
41+
echo "date=$DATE" >> $GITHUB_OUTPUT
42+
echo "zip_name=testpilot-${SHA_SHORT}.zip" >> $GITHUB_OUTPUT
43+
44+
# ── Zip the dist folder ─────────────────────────────────────────────────
45+
- name: Zip dist folder
46+
run: |
47+
cd dist
48+
zip -r "../${{ steps.build_info.outputs.zip_name }}" .
49+
cd ..
50+
echo "Created ${{ steps.build_info.outputs.zip_name }}"
51+
ls -lh "${{ steps.build_info.outputs.zip_name }}"
52+
53+
# ── Upload zip as a workflow artifact (available on every PR + push) ────
54+
- name: Upload extension zip (artifact)
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: testpilot-${{ steps.build_info.outputs.sha_short }}
58+
path: ${{ steps.build_info.outputs.zip_name }}
59+
retention-days: 14
60+
61+
# ── On main: create/update a "latest" GitHub Release with the zip ───────
62+
- name: Create or update latest Release
63+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
64+
uses: softprops/action-gh-release@v2
65+
with:
66+
tag_name: latest
67+
name: "TestPilot – Latest Build (${{ steps.build_info.outputs.date }})"
68+
body: |
69+
## ⬇️ Install TestPilot
70+
71+
1. Download `testpilot-${{ steps.build_info.outputs.sha_short }}.zip` below
72+
2. Unzip it anywhere on your machine
73+
3. Open `chrome://extensions` in Chrome
74+
4. Enable **Developer mode** (top-right toggle)
75+
5. Click **Load unpacked** and select the unzipped folder
76+
77+
---
78+
**Commit:** `${{ steps.build_info.outputs.sha_short }}`
79+
**Built:** ${{ steps.build_info.outputs.date }}
80+
files: ${{ steps.build_info.outputs.zip_name }}
81+
prerelease: false
82+
make_latest: true

0 commit comments

Comments
 (0)