docs: إضافة التفصيلي لإدارة الإصدارات وآلية أتمتتها #18
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: | |
| - main | |
| - beta | |
| - alpha | |
| - next | |
| - 1.x | |
| - 2.x | |
| - 3.x | |
| - 4.x | |
| - 1.x.x | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| release: | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| name: Semantic Release | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Debug - List files | |
| run: | | |
| echo "Current directory contents:" | |
| ls -la | |
| echo "" | |
| echo "package.json exists: $(test -f package.json && echo 'YES' || echo 'NO')" | |
| echo "package-lock.json exists: $(test -f package-lock.json && echo 'YES' || echo 'NO')" | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Initialize project | |
| run: | | |
| # Create minimal package.json | |
| if [ ! -f "package.json" ]; then | |
| npm init -y | |
| # Update with minimal config | |
| jq '. + { | |
| "version": "0.0.0-development", | |
| "scripts": { | |
| "test": "echo \"Running tests...\" && exit 0", | |
| "build": "echo \"Building...\" && exit 0" | |
| } | |
| }' package.json > package.json.tmp && mv package.json.tmp package.json | |
| fi | |
| # Generate lock file | |
| npm install --package-lock-only --no-audit | |
| echo "After initialization:" | |
| ls -la package*.json | |
| - name: Install semantic-release | |
| run: | | |
| echo "Installing semantic-release packages..." | |
| npm install \ | |
| semantic-release \ | |
| @semantic-release/changelog \ | |
| @semantic-release/commit-analyzer \ | |
| @semantic-release/exec \ | |
| @semantic-release/git \ | |
| @semantic-release/github \ | |
| @semantic-release/npm \ | |
| @semantic-release/release-notes-generator \ | |
| conventional-changelog-conventionalcommits \ | |
| --no-audit --progress=false | |
| echo "Packages installed:" | |
| npm list --depth=0 | grep semantic | |
| - name: Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| echo "Running semantic-release..." | |
| npx semantic-release --debug |