Skip to content

Commit d83d346

Browse files
authored
🏗️ Add release infrastructure for Ember SDK (#167)
## Summary Adds complete release infrastructure for the new Ember SDK to match other client SDKs. - Add `release-ember-client.yml` workflow with prerelease support (publishes to `@beta` tag) - Add CI test job on `blacksmith-4vcpu-ubuntu-2404` with Playwright browser caching - Add full E2E visual tests running through `vizzly run` with `VIZZLY_EMBER_CLIENT_TOKEN` - Add `CHANGELOG.md` for initial v0.0.1-beta.0 release - Add `LICENSE` symlink to root license - Update version to `0.0.1-beta.0` - Fix lint errors in integration tests (unused params) ### CI Test Coverage | Step | Command | |------|---------| | Unit tests | `npm test` | | Integration tests | `npm run test:integration` | | E2E visual tests | `vizzly run "npx testem ci"` | ## Test plan - [ ] CI passes with all test steps - [ ] E2E visual tests upload to Vizzly (token is set) - [ ] Release workflow can be triggered manually
1 parent ef8a406 commit d83d346

File tree

10 files changed

+459
-25
lines changed

10 files changed

+459
-25
lines changed

.github/workflows/ci.yml

Lines changed: 107 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
lint:
1111
runs-on: ubuntu-latest
12+
timeout-minutes: 8
1213
steps:
1314
- uses: actions/checkout@v4
1415

@@ -29,6 +30,7 @@ jobs:
2930

3031
test:
3132
runs-on: blacksmith-4vcpu-ubuntu-2404
33+
timeout-minutes: 8
3234
needs: lint
3335

3436
strategy:
@@ -60,6 +62,7 @@ jobs:
6062

6163
test-site:
6264
runs-on: blacksmith-4vcpu-ubuntu-2404
65+
timeout-minutes: 8
6366
needs: lint
6467

6568
steps:
@@ -109,6 +112,7 @@ jobs:
109112

110113
test-reporter:
111114
runs-on: blacksmith-4vcpu-ubuntu-2404
115+
timeout-minutes: 8
112116
needs: lint
113117

114118
steps:
@@ -151,6 +155,7 @@ jobs:
151155

152156
test-tui:
153157
runs-on: ubuntu-latest
158+
timeout-minutes: 8
154159
needs: lint
155160

156161
steps:
@@ -196,6 +201,7 @@ jobs:
196201
197202
test-ruby-client:
198203
runs-on: ubuntu-latest
204+
timeout-minutes: 8
199205
needs: [lint, changes-ruby]
200206
if: needs.changes-ruby.outputs.ruby == 'true'
201207

@@ -303,8 +309,24 @@ jobs:
303309
- '.github/workflows/ci.yml'
304310
- '.github/workflows/release-swift-client.yml'
305311
312+
changes-ember:
313+
runs-on: ubuntu-latest
314+
outputs:
315+
ember: ${{ steps.filter.outputs.ember }}
316+
steps:
317+
- uses: actions/checkout@v4
318+
- uses: dorny/paths-filter@v3
319+
id: filter
320+
with:
321+
filters: |
322+
ember:
323+
- 'clients/ember/**'
324+
- '.github/workflows/ci.yml'
325+
- '.github/workflows/release-ember-client.yml'
326+
306327
test-storybook-client:
307328
runs-on: ubuntu-latest
329+
timeout-minutes: 8
308330
needs: [lint, changes-storybook]
309331
if: needs.changes-storybook.outputs.storybook == 'true'
310332

@@ -346,6 +368,7 @@ jobs:
346368

347369
test-static-site-client:
348370
runs-on: ubuntu-latest
371+
timeout-minutes: 8
349372
needs: [lint, changes-static-site]
350373
if: needs.changes-static-site.outputs.static-site == 'true'
351374

@@ -387,6 +410,7 @@ jobs:
387410

388411
test-vitest-client:
389412
runs-on: blacksmith-4vcpu-ubuntu-2404
413+
timeout-minutes: 8
390414
needs: [lint, changes-vitest]
391415
if: needs.changes-vitest.outputs.vitest == 'true'
392416

@@ -440,6 +464,7 @@ jobs:
440464
CI: true
441465

442466
- name: Run Vitest client E2E tests
467+
if: matrix.node-version == 22
443468
working-directory: ./clients/vitest
444469
run: ../../bin/vizzly.js run "npm run test:e2e"
445470
env:
@@ -450,6 +475,7 @@ jobs:
450475

451476
test-swift-client:
452477
runs-on: macos-latest
478+
timeout-minutes: 8
453479
needs: [lint, changes-swift]
454480
if: needs.changes-swift.outputs.swift == 'true'
455481

@@ -471,9 +497,84 @@ jobs:
471497
working-directory: ./clients/swift
472498
run: swift test
473499

500+
test-ember-client:
501+
runs-on: blacksmith-4vcpu-ubuntu-2404
502+
timeout-minutes: 8
503+
needs: [lint, changes-ember]
504+
if: needs.changes-ember.outputs.ember == 'true'
505+
506+
strategy:
507+
matrix:
508+
node-version: [22, 24]
509+
510+
steps:
511+
- uses: actions/checkout@v4
512+
513+
- name: Use Node.js ${{ matrix.node-version }}
514+
uses: actions/setup-node@v4
515+
with:
516+
node-version: ${{ matrix.node-version }}
517+
518+
- name: Install CLI dependencies
519+
run: npm ci
520+
521+
- name: Build CLI
522+
run: npm run build
523+
524+
- name: Install Ember client dependencies
525+
working-directory: ./clients/ember
526+
run: npm install
527+
528+
- name: Get installed Playwright version
529+
working-directory: ./clients/ember
530+
id: playwright-version
531+
run: echo "version=$(npx playwright --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT
532+
533+
- name: Cache Playwright browsers
534+
uses: actions/cache@v4
535+
id: playwright-cache
536+
with:
537+
path: ~/.cache/ms-playwright
538+
key: playwright-browsers-${{ steps.playwright-version.outputs.version }}-chromium
539+
540+
- name: Install Playwright browsers
541+
if: steps.playwright-cache.outputs.cache-hit != 'true'
542+
working-directory: ./clients/ember
543+
run: npx playwright install chromium --with-deps
544+
545+
- name: Run linter
546+
working-directory: ./clients/ember
547+
run: npm run lint
548+
549+
- name: Run unit tests
550+
working-directory: ./clients/ember
551+
run: npm test
552+
env:
553+
CI: true
554+
555+
- name: Run integration tests
556+
working-directory: ./clients/ember
557+
run: npm run test:integration
558+
env:
559+
CI: true
560+
561+
- name: Run Ember E2E visual tests
562+
if: matrix.node-version == 22
563+
working-directory: ./clients/ember
564+
run: |
565+
cd test-app
566+
npm install
567+
npm run build -- --mode development
568+
../../../bin/vizzly.js run "npx testem ci --file testem.cjs"
569+
env:
570+
CI: true
571+
VIZZLY_TOKEN: ${{ secrets.VIZZLY_EMBER_CLIENT_TOKEN }}
572+
VIZZLY_COMMIT_MESSAGE: ${{ github.event.pull_request.head.commit.message || github.event.head_commit.message }}
573+
VIZZLY_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.event.head_commit.id }}
574+
474575
ci-check:
475576
runs-on: ubuntu-latest
476-
needs: [lint, test, test-site, test-reporter, test-tui, changes-ruby, test-ruby-client, changes-storybook, test-storybook-client, changes-static-site, test-static-site-client, changes-vitest, test-vitest-client, changes-swift, test-swift-client]
577+
needs: [lint, test, test-site, test-reporter, test-tui, changes-ruby, test-ruby-client, changes-storybook, test-storybook-client, changes-static-site, test-static-site-client, changes-vitest, test-vitest-client, changes-swift, test-swift-client, changes-ember, test-ember-client]
477578
if: always()
478579
steps:
479580
- name: Check if all jobs passed
@@ -510,4 +611,9 @@ jobs:
510611
exit 1
511612
fi
512613
614+
if [[ "${{ needs.changes-ember.outputs.ember }}" == "true" && "${{ needs.test-ember-client.result }}" == "failure" ]]; then
615+
echo "Ember client tests failed"
616+
exit 1
617+
fi
618+
513619
echo "All jobs passed"
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
name: Release Ember Client
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version_type:
7+
description: 'Version bump type'
8+
required: true
9+
default: 'patch'
10+
type: choice
11+
options:
12+
- patch
13+
- minor
14+
- major
15+
prerelease:
16+
description: 'Create prerelease (beta tag)?'
17+
required: false
18+
default: false
19+
type: boolean
20+
21+
jobs:
22+
release:
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: write
26+
id-token: write
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
with:
32+
token: ${{ secrets.RELEASE_PAT || secrets.GITHUB_TOKEN }}
33+
fetch-depth: 0
34+
35+
- name: Set up Node.js
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: '22'
39+
registry-url: 'https://registry.npmjs.org'
40+
41+
- name: Configure git
42+
run: |
43+
git config --local user.email "${{ secrets.GIT_USER_EMAIL }}"
44+
git config --local user.name "${{ secrets.GIT_USER_NAME }}"
45+
46+
- name: Ensure we have latest main
47+
run: |
48+
git fetch origin main
49+
git reset --hard origin/main
50+
51+
- name: Get current version
52+
id: current_version
53+
working-directory: ./clients/ember
54+
run: |
55+
CURRENT_VERSION=$(node -p "require('./package.json').version")
56+
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
57+
58+
- name: Bump version
59+
id: version
60+
working-directory: ./clients/ember
61+
run: |
62+
if [ "${{ github.event.inputs.prerelease }}" == "true" ]; then
63+
NEW_VERSION=$(npm version pre${{ github.event.inputs.version_type }} --preid=beta --no-git-tag-version | sed 's/v//')
64+
else
65+
NEW_VERSION=$(npm version ${{ github.event.inputs.version_type }} --no-git-tag-version | sed 's/v//')
66+
fi
67+
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
68+
echo "tag=ember/v$NEW_VERSION" >> $GITHUB_OUTPUT
69+
70+
- name: Generate changelog with Claude
71+
id: changelog
72+
uses: anthropics/claude-code-action@v1
73+
with:
74+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
75+
prompt: |
76+
Generate release notes for the Vizzly Ember SDK v${{ steps.version.outputs.version }}.
77+
78+
Context:
79+
- Client location: `clients/ember/`
80+
- Previous tag: `ember/v${{ steps.current_version.outputs.version }}`
81+
- New version: `${{ steps.version.outputs.version }}`
82+
- This is a monorepo with multiple clients and a CLI
83+
84+
Instructions:
85+
1. Use git commands (via Bash tool) to get commits since last ember/* tag
86+
2. Analyze which commits are relevant to `clients/ember/`
87+
3. Read the code changes if needed to understand impact
88+
4. Generate user-friendly release notes with categories: Added, Changed, Fixed
89+
5. Focus on user-facing changes only
90+
6. If no relevant changes, output: "No changes to Ember SDK in this release"
91+
92+
Save the changelog to `clients/ember/CHANGELOG-RELEASE.md` with this format:
93+
94+
## What's Changed
95+
96+
### Added
97+
- New features
98+
99+
### Changed
100+
- Breaking or notable changes
101+
102+
### Fixed
103+
- Bug fixes
104+
105+
**Full Changelog**: https://github.com/vizzly-testing/cli/compare/ember/v${{ steps.current_version.outputs.version }}...ember/v${{ steps.version.outputs.version }}
106+
claude_args: '--allowed-tools "Bash(git:*),Write"'
107+
108+
- name: Install dependencies
109+
working-directory: ./clients/ember
110+
run: npm install
111+
112+
- name: Run tests
113+
working-directory: ./clients/ember
114+
run: npm test
115+
116+
- name: Run linter
117+
working-directory: ./clients/ember
118+
run: npm run lint
119+
120+
- name: Update CHANGELOG.md
121+
working-directory: ./clients/ember
122+
run: |
123+
# Check if changelog was generated successfully
124+
if [ ! -f CHANGELOG-RELEASE.md ]; then
125+
echo "Warning: CHANGELOG-RELEASE.md not found, creating fallback changelog"
126+
cat > CHANGELOG-RELEASE.md << 'EOF'
127+
## What's Changed
128+
129+
Release v${{ steps.version.outputs.version }}
130+
131+
See the full diff for detailed changes.
132+
EOF
133+
fi
134+
135+
# Prepend new release to CHANGELOG.md
136+
echo -e "# Changelog\n" > CHANGELOG-NEW.md
137+
echo "All notable changes to this project will be documented in this file." >> CHANGELOG-NEW.md
138+
echo "" >> CHANGELOG-NEW.md
139+
echo "The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)," >> CHANGELOG-NEW.md
140+
echo "and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)." >> CHANGELOG-NEW.md
141+
echo "" >> CHANGELOG-NEW.md
142+
echo "## [${{ steps.version.outputs.version }}] - $(date +%Y-%m-%d)" >> CHANGELOG-NEW.md
143+
echo "" >> CHANGELOG-NEW.md
144+
cat CHANGELOG-RELEASE.md >> CHANGELOG-NEW.md
145+
echo "" >> CHANGELOG-NEW.md
146+
tail -n +8 CHANGELOG.md >> CHANGELOG-NEW.md
147+
mv CHANGELOG-NEW.md CHANGELOG.md
148+
rm CHANGELOG-RELEASE.md
149+
150+
- name: Reconfigure git auth
151+
run: |
152+
git config --local user.email "${{ secrets.GIT_USER_EMAIL }}"
153+
git config --local user.name "${{ secrets.GIT_USER_NAME }}"
154+
git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n x-access-token:${{ secrets.RELEASE_PAT || secrets.GITHUB_TOKEN }} | base64)"
155+
156+
- name: Commit and push changes
157+
run: |
158+
git add clients/ember/package.json clients/ember/CHANGELOG.md
159+
git commit -m "🔖 Ember SDK v${{ steps.version.outputs.version }}"
160+
git push origin main
161+
git tag "${{ steps.version.outputs.tag }}"
162+
git push origin "${{ steps.version.outputs.tag }}"
163+
164+
- name: Publish to npm
165+
working-directory: ./clients/ember
166+
run: |
167+
if [ "${{ github.event.inputs.prerelease }}" == "true" ]; then
168+
npm publish --provenance --access public --tag beta
169+
else
170+
npm publish --provenance --access public
171+
fi
172+
env:
173+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
174+
175+
- name: Read changelog for release
176+
id: release_notes
177+
working-directory: ./clients/ember
178+
run: |
179+
# Extract just this version's changelog
180+
CHANGELOG=$(sed -n '/## \[${{ steps.version.outputs.version }}\]/,/## \[/p' CHANGELOG.md | sed '$ d')
181+
{
182+
echo 'notes<<CHANGELOG_EOF'
183+
echo "$CHANGELOG"
184+
echo 'CHANGELOG_EOF'
185+
} >> $GITHUB_OUTPUT
186+
187+
- name: Create GitHub Release
188+
uses: softprops/action-gh-release@v2
189+
with:
190+
tag_name: ${{ steps.version.outputs.tag }}
191+
name: 🐹 Ember SDK v${{ steps.version.outputs.version }}
192+
body: ${{ steps.release_notes.outputs.notes }}
193+
files: ./clients/ember/*.tgz
194+
draft: false
195+
prerelease: ${{ github.event.inputs.prerelease }}
196+
env:
197+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)