Skip to content

Commit 73e764f

Browse files
committed
fix: - sync job;
1 parent 575875a commit 73e764f

11 files changed

Lines changed: 1443 additions & 18 deletions

.github/workflows/beta-release.yml

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
name: Beta Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
beta_type:
7+
description: 'Beta release type'
8+
required: true
9+
default: 'beta'
10+
type: choice
11+
options:
12+
- beta
13+
- alpha
14+
- rc
15+
version_bump:
16+
description: 'Version bump for beta'
17+
required: true
18+
default: 'prerelease'
19+
type: choice
20+
options:
21+
- prerelease
22+
- prepatch
23+
- preminor
24+
- premajor
25+
custom_version:
26+
description: 'Custom version (optional, e.g., 1.0.0-beta.1)'
27+
required: false
28+
type: string
29+
30+
permissions:
31+
contents: write
32+
packages: write
33+
id-token: write
34+
35+
jobs:
36+
beta-release:
37+
name: Beta Release & Publish
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- name: Checkout code
42+
uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 0
45+
token: ${{ secrets.GITHUB_TOKEN }}
46+
47+
- name: Setup Node.js
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version: '20.x'
51+
registry-url: 'https://registry.npmjs.org'
52+
53+
- name: Cache node_modules
54+
uses: actions/cache@v4
55+
id: npm-cache
56+
with:
57+
path: node_modules
58+
key: ${{ runner.os }}-node-20.x-${{ hashFiles('**/package-lock.json') }}
59+
restore-keys: |
60+
${{ runner.os }}-node-20.x-
61+
62+
- name: Install dependencies
63+
if: steps.npm-cache.outputs.cache-hit != 'true'
64+
run: npm ci
65+
66+
- name: Configure Git
67+
run: |
68+
git config user.name "github-actions[bot]"
69+
git config user.email "github-actions[bot]@users.noreply.github.com"
70+
71+
- name: Run quality checks
72+
run: |
73+
npm run lint
74+
npm run type-check
75+
npm test
76+
77+
- name: Build library
78+
run: npm run build
79+
80+
- name: Determine beta version
81+
id: version
82+
run: |
83+
CURRENT_VERSION=$(node -p "require('./package.json').version")
84+
echo "Current version: $CURRENT_VERSION"
85+
86+
if [ -n "${{ github.event.inputs.custom_version }}" ]; then
87+
NEW_VERSION="${{ github.event.inputs.custom_version }}"
88+
npm version $NEW_VERSION --no-git-tag-version --allow-same-version
89+
else
90+
# Use npm version with preid
91+
case "${{ github.event.inputs.version_bump }}" in
92+
prerelease)
93+
npm version prerelease --preid=${{ github.event.inputs.beta_type }} --no-git-tag-version
94+
;;
95+
prepatch)
96+
npm version prepatch --preid=${{ github.event.inputs.beta_type }} --no-git-tag-version
97+
;;
98+
preminor)
99+
npm version preminor --preid=${{ github.event.inputs.beta_type }} --no-git-tag-version
100+
;;
101+
premajor)
102+
npm version premajor --preid=${{ github.event.inputs.beta_type }} --no-git-tag-version
103+
;;
104+
esac
105+
fi
106+
107+
NEW_VERSION=$(node -p "require('./package.json').version")
108+
echo "New version: $NEW_VERSION"
109+
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
110+
echo "is_beta=true" >> $GITHUB_OUTPUT
111+
112+
- name: Generate beta changelog entry
113+
run: |
114+
VERSION="${{ steps.version.outputs.new_version }}"
115+
DATE=$(date +%Y-%m-%d)
116+
117+
# Create changelog entry for beta
118+
cat > CHANGELOG_ENTRY.md << EOF
119+
## v$VERSION - $DATE (Beta Release)
120+
121+
### 🧪 Beta Changes
122+
EOF
123+
124+
# Add recent commits since last tag
125+
if git describe --tags --abbrev=0 2>/dev/null; then
126+
git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"- %s" >> CHANGELOG_ENTRY.md
127+
else
128+
git log --pretty=format:"- %s" -10 >> CHANGELOG_ENTRY.md
129+
fi
130+
131+
echo "" >> CHANGELOG_ENTRY.md
132+
echo "> ⚠️ **This is a beta release** - use with caution in production environments" >> CHANGELOG_ENTRY.md
133+
134+
# Prepend to CHANGELOG.md
135+
if [ -f CHANGELOG.md ]; then
136+
head -n 2 CHANGELOG.md > CHANGELOG_NEW.md
137+
cat CHANGELOG_ENTRY.md >> CHANGELOG_NEW.md
138+
echo "" >> CHANGELOG_NEW.md
139+
tail -n +3 CHANGELOG.md >> CHANGELOG_NEW.md
140+
mv CHANGELOG_NEW.md CHANGELOG.md
141+
else
142+
echo "# Changelog" > CHANGELOG.md
143+
echo "" >> CHANGELOG.md
144+
cat CHANGELOG_ENTRY.md >> CHANGELOG.md
145+
fi
146+
147+
rm CHANGELOG_ENTRY.md
148+
149+
- name: Commit beta version
150+
run: |
151+
git add package.json CHANGELOG.md
152+
git commit -m "chore(release): v${{ steps.version.outputs.new_version }} [beta] [skip ci]" || echo "No changes to commit"
153+
154+
- name: Create beta tag
155+
run: |
156+
git tag -a v${{ steps.version.outputs.new_version }} -m "Beta Release v${{ steps.version.outputs.new_version }}"
157+
158+
- name: Push beta changes
159+
run: |
160+
git push origin ${{ github.ref_name }} --follow-tags
161+
162+
- name: Publish beta to NPM
163+
run: |
164+
echo "Publishing beta version to NPM..."
165+
npm publish --tag ${{ github.event.inputs.beta_type }} --access public
166+
env:
167+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
168+
169+
- name: Create GitHub Pre-release
170+
uses: softprops/action-gh-release@v2
171+
with:
172+
tag_name: v${{ steps.version.outputs.new_version }}
173+
name: 🧪 Beta Release v${{ steps.version.outputs.new_version }}
174+
body: |
175+
## 🧪 Beta Release v${{ steps.version.outputs.new_version }}
176+
177+
This is a **beta release** of @nexcraft/forge.
178+
179+
### Installation
180+
```bash
181+
npm install @nexcraft/forge@${{ github.event.inputs.beta_type }}
182+
```
183+
184+
### ⚠️ Beta Warning
185+
This version may contain experimental features and should be used with caution in production environments.
186+
187+
### What's Changed
188+
See CHANGELOG.md for detailed changes.
189+
190+
**Full Changelog**: https://github.com/dev-ignis/forge/commits/v${{ steps.version.outputs.new_version }}
191+
draft: false
192+
prerelease: true
193+
files: |
194+
dist/nexcraft-forge.es.js
195+
dist/nexcraft-forge.umd.js
196+
dist/index.d.ts
197+
198+
- name: Summary
199+
run: |
200+
echo "🎉 Beta release completed successfully!"
201+
echo "📦 Version: ${{ steps.version.outputs.new_version }}"
202+
echo "🏷️ NPM Tag: ${{ github.event.inputs.beta_type }}"
203+
echo "📥 Install: npm install @nexcraft/forge@${{ github.event.inputs.beta_type }}"
204+
echo "🔗 Release: https://github.com/dev-ignis/forge/releases/tag/v${{ steps.version.outputs.new_version }}"

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branches: [main, develop]
5+
branches: [develop] # Only run on develop, not main
66
# Skip CI if release workflow will handle it
77
tags-ignore:
88
- 'v*'

.github/workflows/sync-branches.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,29 @@ on:
88
jobs:
99
sync:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: read
1114
steps:
1215
- name: Checkout
1316
uses: actions/checkout@v4
1417
with:
1518
fetch-depth: 0
16-
token: ${{ secrets.GITHUB_TOKEN }}
19+
token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '20.x'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run basic checks
30+
run: |
31+
npm run lint
32+
npm run type-check
33+
npm run build
1734
1835
- name: Configure Git
1936
run: |

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## v0.5.0 - 2025-09-06
4+
5+
### Changes
6+
- Merge pull request #10 from dev-ignis/develop
7+
- Merge branch 'main' into develop
8+
- docs: - changelog;
9+
- feat: - sync main and develop;
10+
- docs: - roadmap;
311
All notable changes to @nexcraft/forge will be documented in this file.
412

513
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

docs/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ Welcome to the Forge UI Component Library documentation. This directory contains
2626
- **[Angular Integration](./guides/angular-integration.md)** - Using with Angular
2727
- **[Vanilla JS](./guides/vanilla-js.md)** - Using without a framework
2828

29+
### Publishing & Release Management
30+
- **[Release Process](./guides/release-process.md)** - Complete release workflow
31+
- **[NPM Publishing](./guides/npm-publishing.md)** - Package publishing guide
32+
- **[Beta Releases](./guides/beta-releases.md)** - Beta/alpha release process
33+
- **[Git Workflow](./git-workflow.md)** - Branch strategy and synchronization
34+
2935
### Contributing
3036
- **[Contributing Guide](./CONTRIBUTING.md)** - How to contribute
3137
- **[Code of Conduct](./CODE_OF_CONDUCT.md)** - Community guidelines

0 commit comments

Comments
 (0)