Skip to content

Commit a295337

Browse files
authored
chore(build): Add semantic release (#3)
* chore(build): add semantic release
1 parent 9fba210 commit a295337

File tree

7 files changed

+7621
-33
lines changed

7 files changed

+7621
-33
lines changed

.commitlintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"]
3+
}

.github/workflows/release.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
ci:
14+
name: CI
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Check out project
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '18'
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Build schemas
30+
run: npm run build
31+
32+
- name: Verify build output
33+
run: |
34+
echo "Checking component count..."
35+
find components -name "schema.json" | wc -l
36+
echo "Checking main index..."
37+
ls -la index.js
38+
39+
deploy:
40+
name: Deploy release
41+
runs-on: ubuntu-latest
42+
needs: [ci]
43+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
44+
steps:
45+
- name: Check out project
46+
uses: actions/checkout@v4
47+
with:
48+
# Fetch all history for all branches and tags, which is needed for the release script
49+
fetch-depth: 0
50+
token: ${{ secrets.GITHUB_TOKEN }}
51+
52+
- name: Setup Node.js
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: '18'
56+
cache: 'npm'
57+
58+
- name: Install dependencies
59+
run: npm ci
60+
61+
- name: Build schemas
62+
run: npm run build
63+
64+
- name: Deploy to NPM and Github
65+
run: npm run semantic-release
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,48 @@ npm-debug.log*
44
yarn-debug.log*
55
yarn-error.log*
66

7-
# Runtime
8-
.DS_Store
7+
# Runtime data
8+
pids
9+
*.pid
10+
*.seed
11+
*.pid.lock
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage/
15+
.nyc_output
16+
17+
# Environment variables
18+
.env
919
.env.local
1020
.env.development.local
1121
.env.test.local
1222
.env.production.local
1323

24+
# Cache directories
25+
.npm
26+
.eslintcache
27+
28+
# Optional npm cache directory
29+
.npm
30+
31+
# Semantic Release
32+
.semanticrc
33+
34+
# OS generated files
35+
.DS_Store
36+
.DS_Store?
37+
._*
38+
.Spotlight-V100
39+
.Trashes
40+
ehthumbs.db
41+
Thumbs.db
42+
1443
# IDE
1544
.vscode/
1645
.idea/
1746
*.swp
1847
*.swo
1948

20-
# Temporary files
21-
*.tmp
22-
*.temp
23-
2449
# Logs
2550
logs
26-
*.log
27-
28-
# Coverage directory used by tools like istanbul
29-
coverage/
30-
*.lcov
31-
32-
# Build outputs (if any)
33-
dist/
34-
build/
35-
36-
# Sample/test files (optional - remove if you want to keep sample-metadata.json)
37-
sample-metadata.json
51+
*.log

README.md

Lines changed: 60 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# patternfly-component-schemas
1+
# @patternfly/patternfly-component-schemas
22

33
JSON Schema metadata for PatternFly React components, providing structured validation and documentation for component props.
44

55
## 📦 Installation
66

77
```bash
8-
npm install patternfly-component-schemas
8+
npm install @patternfly/patternfly-component-schemas
99
```
1010

1111
## 🏗️ Structure
1212

1313
This package uses a split structure for optimal performance and modularity:
1414

1515
```
16-
patternfly-component-schemas/
16+
@patternfly/patternfly-component-schemas/
1717
├── components/
1818
│ ├── AboutModal/
1919
│ │ ├── schema.json # JSON Schema for AboutModal props
@@ -79,14 +79,19 @@ npm run rebuild
7979
The package is generated from `component-metadata.json` which contains the raw PatternFly component metadata for the latest release. This file is included in the git repository for development but excluded from the NPM package.
8080

8181
### Updating Component Metadata
82-
**Current Process - (Manual)**
82+
83+
**📋 Manual Process (Current)**
8384
1. Clone https://github.com/patternfly/patternfly-doc-core
8485
2. Run `npm run build:props` in the doc-core directory
85-
3. Copy `dist/props.json` content to `component-metadata.json` of this repo.
86+
3. Copy `dist/props.json` content to `component-metadata.json` of this repo
8687
4. Run `npm run build` to regenerate schemas
87-
5. Test and publish
88+
5. Commit with: `feat(components): sync with PatternFly vX.X.X`
89+
6. Push to `main`**automatic release triggers** 🚀
8890

89-
**Future**: This will be automated to sync with PatternFly releases.
91+
**🔮 Future Automation**
92+
- Dependency management via Renovate/Dependabot
93+
- Automated PRs for PatternFly quarterly releases
94+
- Human-in-the-loop review for component updates
9095

9196
## 📊 Package Contents
9297

@@ -111,12 +116,57 @@ This package is specifically designed for:
111116

112117
MIT
113118

119+
## 🚀 Automated Releases
120+
121+
This package uses **semantic-release** for automated versioning and publishing based on conventional commits.
122+
123+
### Commit Message Format
124+
125+
Follow [Conventional Commits](https://conventionalcommits.org/) specification:
126+
127+
```
128+
<type>[optional scope]: <description>
129+
```
130+
131+
**Examples:**
132+
```bash
133+
feat: add new component schemas
134+
fix: correct required props validation
135+
docs: update installation instructions
136+
chore: update dependencies
137+
```
138+
139+
### Release Process
140+
141+
1. **Push commits** to `main` branch using conventional format
142+
2. **GitHub Actions** runs CI and tests
143+
3. **Semantic-release** analyzes commits and publishes to NPM
144+
4. **GitHub releases** created automatically
145+
114146
## 🤝 Contributing
115147

116148
1. Fork the repository
117-
2. Update `component-metadata.json` with your changes
118-
3. Run `npm run build` to regenerate schemas
119-
4. Submit a pull request
149+
2. Create a feature branch
150+
3. Update `component-metadata.json` with your changes
151+
4. Run `npm run build` to regenerate schemas
152+
5. Commit using conventional commit format
153+
6. Submit a pull request
154+
155+
### Development Setup
156+
157+
```bash
158+
# Install dependencies
159+
npm install
160+
161+
# Build schemas
162+
npm run build
163+
164+
# Watch for changes
165+
npm run dev
166+
167+
# Clean and rebuild
168+
npm run rebuild
169+
```
120170

121171
---
122172

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Auto-generated index file for PatternFly component schemas
2-
// Generated on: 2025-09-11T19:09:50.573Z
2+
// Generated on: 2025-09-16T13:47:33.613Z
33

44
export { default as KeyboardHandler } from './components/KeyboardHandler/index.js';
55
export { default as SampleDataRow } from './components/SampleDataRow/index.js';

0 commit comments

Comments
 (0)