name: Release on: push: branches: [main] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: false jobs: build: name: Build runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v6 with: fetch-depth: 0 - name: Setup Node.js uses: actions/setup-node@v6 with: node-version: 24 cache: 'npm' - name: Cache Turborepo uses: actions/cache@v5 with: path: node_modules/.cache/turbo key: ${{ runner.os }}-turbo-${{ github.sha }} restore-keys: | ${{ runner.os }}-turbo- - name: Install dependencies run: npm ci --ignore-scripts - name: Build packages run: npm run build - name: Upload build artifacts uses: actions/upload-artifact@v7 with: name: release-build-artifacts path: | packages/*/dist packages/*/lib retention-days: 1 test: name: Test runs-on: ubuntu-latest needs: build steps: - name: Checkout uses: actions/checkout@v6 - name: Setup Node.js uses: actions/setup-node@v6 with: node-version: 24 cache: 'npm' - name: Install dependencies run: npm ci --ignore-scripts - name: Download build artifacts uses: actions/download-artifact@v8 with: name: release-build-artifacts path: packages - name: Run unit tests run: npm test types: name: Type Check runs-on: ubuntu-latest needs: build steps: - name: Checkout uses: actions/checkout@v6 - name: Setup Node.js uses: actions/setup-node@v6 with: node-version: 24 cache: 'npm' - name: Install dependencies run: npm ci --ignore-scripts - name: Download build artifacts uses: actions/download-artifact@v8 with: name: release-build-artifacts path: packages - name: Run type check run: npm run test:types lint: name: Lint runs-on: ubuntu-latest needs: build steps: - name: Checkout uses: actions/checkout@v6 - name: Setup Node.js uses: actions/setup-node@v6 with: node-version: 24 cache: 'npm' - name: Install dependencies run: npm ci --ignore-scripts - name: Download build artifacts uses: actions/download-artifact@v8 with: name: release-build-artifacts path: packages - name: Run linter run: npm run lint size: name: Bundle Size runs-on: ubuntu-latest needs: build steps: - name: Checkout uses: actions/checkout@v6 - name: Setup Node.js uses: actions/setup-node@v6 with: node-version: 24 cache: 'npm' - name: Install dependencies run: npm ci --ignore-scripts - name: Download build artifacts uses: actions/download-artifact@v8 with: name: release-build-artifacts path: packages - name: Check bundle size run: npm run test:size release: name: Release runs-on: ubuntu-latest needs: [build, test, types, lint, size] permissions: id-token: write contents: write steps: - name: Checkout uses: actions/checkout@v6 with: fetch-depth: 0 - name: Setup Node.js uses: actions/setup-node@v6 with: node-version: 24 registry-url: 'https://registry.npmjs.org' cache: 'npm' - name: Install dependencies run: npm ci --ignore-scripts - name: Download build artifacts uses: actions/download-artifact@v8 with: name: release-build-artifacts path: packages - name: Configure git run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - name: Release if needed run: npx shipjs trigger env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}