This repository was archived by the owner on Mar 7, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
208 lines (169 loc) · 6.76 KB
/
release.yml
File metadata and controls
208 lines (169 loc) · 6.76 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: "Version to release (e.g., v0.1.0-beta)"
required: true
type: string
permissions:
contents: write
packages: write
pages: write
id-token: write
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
registry-url: "https://npm.pkg.github.com"
scope: "@etherisc"
- name: Install dependencies
run: pnpm install
- name: Extract version
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.version }}"
else
VERSION="${GITHUB_REF#refs/tags/}"
fi
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "Version: ${VERSION}"
- name: Generate build hash
id: build-hash
run: |
HASH=$(echo "${{ github.sha }}" | cut -c1-8)
echo "hash=${HASH}" >> $GITHUB_OUTPUT
echo "Build hash: ${HASH}"
- name: Run tests
run: cd packages/ui-kit && pnpm test
- name: Run linting
run: cd packages/ui-kit && pnpm lint
- name: Build package
run: pnpm build
- name: Check bundle size
run: cd packages/ui-kit && pnpm run size-limit
- name: Build Storybook
run: cd packages/ui-kit && pnpm run build-storybook
- name: Add build info to Storybook
run: |
cd packages/ui-kit
echo "window.BUILD_INFO = { version: '${{ steps.version.outputs.version }}', hash: '${{ steps.build-hash.outputs.hash }}', timestamp: '$(date -u +"%Y-%m-%dT%H:%M:%SZ")' };" > storybook-static/build-info.js
# Inject build info script into index.html
sed -i 's|</head>|<script src="./build-info.js"></script></head>|' storybook-static/index.html
- name: Update package.json for npm release
run: |
VERSION="${{ steps.version.outputs.version }}"
VERSION_NO_V=${VERSION#v}
cd packages/ui-kit
# Create a backup of the original package.json
cp package.json package.json.backup
# Update package.json using jq for reliable JSON manipulation
jq --arg name "@etherisc/ui-kit" \
--arg version "${VERSION_NO_V}" \
--arg repo_url "git+https://github.com/${{ github.repository }}.git" \
'.name = $name |
.version = $version |
.private = false |
.repository.type = "git" |
.repository.url = $repo_url' \
package.json > package.json.tmp && mv package.json.tmp package.json
echo "Updated package.json for npm publishing:"
cat package.json | jq '.name, .version, .private, .repository'
- name: Publish to GitHub Packages
run: |
cd packages/ui-kit
npm publish --access=public
# Restore original package.json
mv package.json.backup package.json
echo "Restored original package.json"
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Pages
uses: actions/configure-pages@v4
with:
enablement: true
continue-on-error: true
- name: Upload to GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: packages/ui-kit/storybook-static
continue-on-error: true
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
continue-on-error: true
- name: Generate release notes
run: |
VERSION="${{ steps.version.outputs.version }}"
BUILD_HASH="${{ steps.build-hash.outputs.hash }}"
# Set default page URL if deployment failed
PAGE_URL="${{ steps.deployment.outputs.page_url }}"
if [ -z "$PAGE_URL" ]; then
PAGE_URL="https://github.com/${{ github.repository }}/tree/main/packages/ui-kit/storybook-static"
fi
cat > release-notes.md << EOF
# UI Kit ${VERSION}
## 🎉 First Beta Release
This is the first beta release of the UI Kit library, featuring:
### 🧩 Components
- **Form Components**: Button, TextInput, NumberInput, Select, Checkbox, RadioGroup
- **Layout Components**: AuthShell, MainLayout with responsive navigation
- **Data Components**: DataTable with pagination and sorting
- **Feedback Components**: Toast system, StatusBadge, ErrorBoundary
- **Security**: MarkdownEditor with XSS protection via DOMPurify
### 🛠️ Infrastructure
- **TypeScript**: Full type safety and IntelliSense support
- **Styling**: Tailwind CSS + DaisyUI theming system
- **Testing**: Comprehensive unit tests and accessibility testing
- **Documentation**: Interactive Storybook with live examples
- **Internationalization**: i18next integration with English and German locales
- **Error Handling**: Sentry integration with structured logging
- **Performance**: Bundle size monitoring (< 250KB gzipped)
### 📚 Documentation
- [Storybook Demo](${PAGE_URL})
- [Contributing Guide](https://github.com/${{ github.repository }}/blob/main/CONTRIBUTING.md)
- [Design Tokens](https://github.com/${{ github.repository }}/blob/main/DESIGN_TOKENS.md)
### 📦 Installation
\`\`\`bash
npm install @etherisc/ui-kit@${VERSION#v}
# or
pnpm add @etherisc/ui-kit@${VERSION#v}
# or
yarn add @etherisc/ui-kit@${VERSION#v}
\`\`\`
### 🔗 Links
- **Package**: [GitHub Packages](https://github.com/${{ github.repository }}/pkgs/npm/ui-kit)
- **Demo**: [Storybook](${PAGE_URL})
- **Source**: [GitHub](https://github.com/${{ github.repository }})
- **Build**: \`${BUILD_HASH}\`
---
**Note**: This is a beta release. APIs may change before the stable 1.0 release.
EOF
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.version }}
release_name: UI Kit ${{ steps.version.outputs.version }}
body_path: release-notes.md
draft: false
prerelease: true
continue-on-error: true