@@ -2,8 +2,6 @@ name: Release
22
33on :
44 push :
5- branches :
6- - master
75 tags :
86 - ' v*'
97
1311 permissions :
1412 contents : write
1513 packages : write
16-
14+
1715 steps :
1816 - name : Checkout code
1917 uses : actions/checkout@v4
@@ -34,92 +32,55 @@ jobs:
3432 - name : Run tests
3533 run : npm run test:ci
3634
37- - name : Determine release type and version
38- id : release-info
35+ - name : Build package
36+ run : ./package.sh
37+
38+ - name : Determine if beta release
39+ id : check_beta
3940 run : |
40- if [[ $GITHUB_REF == refs/tags/* ]]; then
41- # Tagged release
42- echo "release_type=tagged" >> $GITHUB_OUTPUT
43- echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
44- echo "npm_tag=latest" >> $GITHUB_OUTPUT
45- echo "prerelease=false" >> $GITHUB_OUTPUT
46- else
47- # Auto release from master - use beta
48- PACKAGE_VERSION=$(node -p "require('./package.json').version")
49- BETA_VERSION="${PACKAGE_VERSION}-beta.$(date +%Y%m%d%H%M%S)"
50- echo "release_type=auto" >> $GITHUB_OUTPUT
51- echo "version=v${BETA_VERSION}" >> $GITHUB_OUTPUT
41+ VERSION=$(node -p "require('./package.json').version")
42+ if [[ $VERSION == *"beta"* ]]; then
43+ echo "is_beta=true" >> $GITHUB_OUTPUT
5244 echo "npm_tag=beta" >> $GITHUB_OUTPUT
53- echo "prerelease=true" >> $GITHUB_OUTPUT
54-
55- # Update package.json version for beta
56- npm version $BETA_VERSION --no-git-tag-version
45+ else
46+ echo "is_beta=false" >> $GITHUB_OUTPUT
47+ echo "npm_tag=latest" >> $GITHUB_OUTPUT
5748 fi
49+ echo "version=$VERSION" >> $GITHUB_OUTPUT
5850
59- - name : Build package
60- run : ./package.sh
61-
62- - name : Publish to npm
51+ - name : Publish to NPM
6352 run : |
6453 cd package
65- npm publish --tag ${{ steps.release-info .outputs.npm_tag }}
54+ npm publish --tag ${{ steps.check_beta .outputs.npm_tag }}
6655 env :
6756 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
6857
69- - name : Generate release notes
70- id : release-notes
71- run : |
72- if [[ "${{ steps.release-info.outputs.release_type }}" == "auto" ]]; then
73- # Beta release
74- cat << 'EOF' >> $GITHUB_OUTPUT
75- title=🧪 Prisma 6 Beta Release
76- body=## 🧪 Beta Release - Prisma 6 Support
77-
78- **Try the latest beta with enhanced Prisma 6 support!**
79-
80- ```bash
81- npm install prisma-class-validator-generator@beta
82- ```
83-
84- ### ✨ What's New in This Beta
85-
86- - 🔧 **Prisma 6.12+ Support** - Full compatibility with latest Prisma features
87- - 🛡️ **Uint8Array Support** - Proper handling of Bytes fields (breaking change from Buffer)
88- - 🚀 **Node.js 18+** - Modern Node.js requirements (18.18+, 20.9+, 22.11+)
89- - 📝 **TypeScript 5.8** - Latest TypeScript features and optimizations
90- - 🧪 **Enhanced Testing** - Comprehensive test suite with 95%+ coverage
91- - ⚡ **Performance** - Faster generation with optimized AST manipulation
92-
93- ### 🔄 Migration from v5.0.0
94-
95- 1. Update to Prisma 6.12+: `npm install prisma@latest`
96- 2. Install beta: `npm install prisma-class-validator-generator@beta`
97- 3. Regenerate models: `npx prisma generate`
98- 4. Update any `Buffer` usage to `Uint8Array` if applicable
99-
100- ### 🐛 Feedback & Issues
101-
102- Please test in development and [report any issues](https://github.com/omar-dulaimi/prisma-class-validator-generator/issues). Your feedback helps us deliver a stable v6.0.0 release!
103-
104- **Full Changelog**: [v5.0.0...${{{ steps.release-info.outputs.version }}}](https://github.com/omar-dulaimi/prisma-class-validator-generator/compare/v5.0.0...${{ steps.release-info.outputs.version }})
105- EOF
106- else
107- # Stable release
108- cat << 'EOF' >> $GITHUB_OUTPUT
109- title=${{ steps.release-info.outputs.version }}
110- body=## Changes
111-
112- See the [full changelog](https://github.com/omar-dulaimi/prisma-class-validator-generator/compare/v5.0.0...${{ steps.release-info.outputs.version }}) for details.
113- EOF
114- fi
115-
11658 - name : Create GitHub Release
11759 uses : actions/create-release@v1
11860 env :
11961 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
12062 with :
121- tag_name : ${{ steps.release-info.outputs.version }}
122- release_name : ${{ steps.release-notes.outputs.title }}
123- body : ${{ steps.release-notes.outputs.body }}
63+ tag_name : ${{ github.ref }}
64+ release_name : Release ${{ github.ref }}
12465 draft : false
125- prerelease : ${{ steps.release-info.outputs.prerelease == 'true' }}
66+ prerelease : ${{ steps.check_beta.outputs.is_beta }}
67+ body : |
68+ ## What's Changed
69+
70+ ${{ steps.check_beta.outputs.is_beta == 'true' && '🧪 **This is a beta release** - Please test thoroughly before using in production.' || '' }}
71+
72+ ### ✨ Features in this release
73+
74+ - 🔧 **Prisma 6.12+ Support** - Full compatibility with latest Prisma features
75+ - 🛡️ **Uint8Array Support** - Proper handling of Bytes fields (breaking change from Buffer)
76+ - 🚀 **Node.js 18+** - Modern Node.js requirements (18.18+, 20.9+, 22.11+)
77+ - 📝 **TypeScript 5.8** - Latest TypeScript features and optimizations
78+ - 🧪 **Enhanced Testing** - Comprehensive test suite with 95%+ coverage
79+ - ⚡ **Performance** - Faster generation with optimized AST manipulation
80+
81+ For detailed changes, see the [changelog](https://github.com/omar-dulaimi/prisma-class-validator-generator/compare/v5.0.0...${{ github.ref }}).
82+
83+ ### Installation
84+ ```bash
85+ npm install prisma-class-validator-generator@${{ steps.check_beta.outputs.is_beta == 'true' && 'beta' || 'latest' }}
86+ ```
0 commit comments