Add professional formatting to auto-release workflow #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | ||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| tags: | ||
| - 'v*' | ||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| packages: write | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20.x' | ||
| cache: 'npm' | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| - name: Build project | ||
| run: npm run build | ||
| - name: Run tests | ||
| run: npm run test:ci | ||
| - name: Determine release type and version | ||
| id: release-info | ||
| run: | | ||
| if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
| # Tagged release | ||
| echo "release_type=tagged" >> $GITHUB_OUTPUT | ||
| echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | ||
| echo "npm_tag=latest" >> $GITHUB_OUTPUT | ||
| echo "prerelease=false" >> $GITHUB_OUTPUT | ||
| else | ||
| # Auto release from master - use beta | ||
| PACKAGE_VERSION=$(node -p "require('./package.json').version") | ||
| BETA_VERSION="${PACKAGE_VERSION}-beta.$(date +%Y%m%d%H%M%S)" | ||
| echo "release_type=auto" >> $GITHUB_OUTPUT | ||
| echo "version=v${BETA_VERSION}" >> $GITHUB_OUTPUT | ||
| echo "npm_tag=beta" >> $GITHUB_OUTPUT | ||
| echo "prerelease=true" >> $GITHUB_OUTPUT | ||
| # Update package.json version for beta | ||
| npm version $BETA_VERSION --no-git-tag-version | ||
| fi | ||
| - name: Build package | ||
| run: ./package.sh | ||
| - name: Publish to npm | ||
| run: | | ||
| cd package | ||
| npm publish --tag ${{ steps.release-info.outputs.npm_tag }} | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| - name: Generate release notes | ||
| id: release-notes | ||
| run: | | ||
|
Check failure on line 71 in .github/workflows/release.yml
|
||
| if [[ "${{ steps.release-info.outputs.release_type }}" == "auto" ]]; then | ||
| # Beta release | ||
| cat << 'EOF' >> $GITHUB_OUTPUT | ||
| title=🧪 Prisma 6 Beta Release | ||
| body=## 🧪 Beta Release - Prisma 6 Support | ||
| **Try the latest beta with enhanced Prisma 6 support!** | ||
| ```bash | ||
| npm install prisma-class-validator-generator@beta | ||
| ``` | ||
| ### ✨ What's New in This Beta | ||
| - 🔧 **Prisma 6.12+ Support** - Full compatibility with latest Prisma features | ||
| - 🛡️ **Uint8Array Support** - Proper handling of Bytes fields (breaking change from Buffer) | ||
| - 🚀 **Node.js 18+** - Modern Node.js requirements (18.18+, 20.9+, 22.11+) | ||
| - 📝 **TypeScript 5.8** - Latest TypeScript features and optimizations | ||
| - 🧪 **Enhanced Testing** - Comprehensive test suite with 95%+ coverage | ||
| - ⚡ **Performance** - Faster generation with optimized AST manipulation | ||
| ### 🔄 Migration from v5.0.0 | ||
| 1. Update to Prisma 6.12+: `npm install prisma@latest` | ||
| 2. Install beta: `npm install prisma-class-validator-generator@beta` | ||
| 3. Regenerate models: `npx prisma generate` | ||
| 4. Update any `Buffer` usage to `Uint8Array` if applicable | ||
| ### 🐛 Feedback & Issues | ||
| 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! | ||
| **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 }}) | ||
| EOF | ||
| else | ||
| # Stable release | ||
| cat << 'EOF' >> $GITHUB_OUTPUT | ||
| title=${{ steps.release-info.outputs.version }} | ||
| body=## Changes | ||
| See the [full changelog](https://github.com/omar-dulaimi/prisma-class-validator-generator/compare/v5.0.0...${{ steps.release-info.outputs.version }}) for details. | ||
| EOF | ||
| fi | ||
| - name: Create GitHub Release | ||
| uses: actions/create-release@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| tag_name: ${{ steps.release-info.outputs.version }} | ||
| release_name: ${{ steps.release-notes.outputs.title }} | ||
| body: ${{ steps.release-notes.outputs.body }} | ||
| draft: false | ||
| prerelease: ${{ steps.release-info.outputs.prerelease == 'true' }} | ||