Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 2c11d86

Browse files
committed
feat(release.yaml): cicd test and publish
1 parent e87b421 commit 2c11d86

File tree

2 files changed

+82
-60
lines changed

2 files changed

+82
-60
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.github/workflows/relase.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: release
2+
on:
3+
push:
4+
branches: [main, master]
5+
tags:
6+
- '*.*.*'
7+
pull_request:
8+
branches: [main, master]
9+
10+
jobs:
11+
test-and-publish:
12+
name: Run test and publish
13+
timeout-minutes: 60
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: lts/*
20+
registry-url: 'https://registry.npmjs.org'
21+
22+
- name: Install dependencies
23+
run: |
24+
npm install -g pnpm
25+
pnpm install
26+
27+
- name: Compile TypeScript
28+
run: npx tsc
29+
30+
- name: Copy styles to dist
31+
run: |
32+
mkdir -p dist/core
33+
cp -r src/core/styles dist/core/
34+
35+
- name: Install e2e dependencies
36+
run: |
37+
cd e2e/site
38+
pnpm install
39+
40+
- name: Copy local typedcssx
41+
run: |
42+
rm -rf e2e/site/node_modules/typedcssx/dist
43+
cp -r dist e2e/site/node_modules/typedcssx/
44+
45+
- name: Run Jest tests
46+
run: |
47+
pnpm exec jest --ci --coverage --reporters=github-actions --reporters=summary
48+
49+
- name: Upload coverage report
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: coverage-report
53+
path: coverage/
54+
55+
- name: Install Playwright Browsers
56+
run: pnpm exec playwright install --with-deps
57+
58+
- name: Start Next.js Dev Server
59+
run: pnpm run dev:e2e &
60+
env:
61+
CI: true
62+
63+
- name: Run Playwright tests
64+
run: pnpm exec playwright test
65+
66+
- name: Upload Playwright report
67+
uses: actions/upload-artifact@v4
68+
if: always()
69+
with:
70+
name: playwright-report
71+
path: playwright-report/
72+
retention-days: 30
73+
74+
- name: Publish package
75+
if: success()
76+
run: |
77+
mkdir publish
78+
cp -r bin compiler dist next license readme.md npm/package.json ./publish
79+
cd publish
80+
npm publish
81+
env:
82+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)