ci: أتمتت إعدادات الإصدارات الدلالية مع تكوين GitHub Actions #10
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: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Verify commits | |
| run: | | |
| echo "Last 5 commits:" | |
| git log --oneline -5 | |
| - name: Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} | |
| run: npx semantic-release --debug |