name: Monorepo Pipeline on: push: branches: - main tags: - 'v*' pull_request: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: qa: name: ๐Ÿงช Quality Assurance runs-on: docker steps: - name: Checkout uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@v4 with: version: 10 - name: Set up Node.js uses: actions/setup-node@v4 with: node_version: 20 cache: 'pnpm' - name: Install dependencies run: pnpm install --frozen-lockfile env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Lint run: pnpm lint - name: Test run: pnpm test - name: Build run: pnpm build release: name: ๐Ÿš€ Release needs: qa if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) runs-on: docker env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@v4 with: version: 10 - name: Set up Node.js uses: actions/setup-node@v4 with: node_version: 20 cache: 'pnpm' - name: Install dependencies run: pnpm install --frozen-lockfile - name: Release Packages run: | if [[ "${{ github.ref_type }}" == "tag" ]]; then echo "๐Ÿท๏ธ Tag detected, performing sync release..." pnpm sync-versions pnpm release:tag else echo "๐Ÿš€ Push detected, looking for changesets..." pnpm release fi