docs: preparing for contributions #6
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: CI & Release | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| jobs: | |
| # 🔍 Validaciones en Pull Request | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: "pnpm" | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| run_install: true | |
| # ✅ Linter + Prettier | |
| - name: Lint | |
| run: pnpm lint:fix | |
| - name: Prettier check | |
| run: pnpm format | |
| # ✅ TypeScript type-check | |
| - name: TypeScript check | |
| run: pnpm typecheck | |
| # ✅ Tests con cobertura | |
| - name: Run tests | |
| run: pnpm test | |
| # ✅ Build check | |
| - name: Build | |
| run: pnpm build | |
| # ✅ Audit dependencias | |
| - name: Audit dependencies | |
| run: pnpm depcheck && pnpm audit --prod --audit-level=moderate | |
| # ✅ Commitlint (para semantic-release) | |
| - name: Commitlint | |
| run: pnpm commitlint --from=origin/main --to=HEAD | |
| # 🚀 Release automático en main | |
| release: | |
| needs: validate | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| concurrency: release | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: "pnpm" | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| run_install: true | |
| # 🔑 Semantic Release | |
| - name: Semantic Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: pnpm semantic-release |