diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1baf543..c9d0899 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,6 +37,23 @@ jobs: runs-on: ubuntu-latest permissions: contents: read + services: + # `pnpm --filter @cv/api schema:generate` boots AppModule which + # connects to Postgres. CI's Typecheck job has the same service for + # the same reason - see CVG-100 / CVG-116. + postgres: + image: postgres:16 + env: + POSTGRES_USER: schemagen + POSTGRES_PASSWORD: schemagen + POSTGRES_DB: schemagen + ports: + - 5432:5432 + options: >- + --health-cmd "pg_isready -U schemagen" + --health-interval 10s + --health-timeout 5s + --health-retries 5 steps: - uses: actions/checkout@v4 @@ -63,6 +80,17 @@ jobs: NPM_AUTH_TOKEN: ${{ steps.app-token.outputs.token }} run: pnpm install --frozen-lockfile + - name: Generate Prisma client + run: pnpm prisma:generate + + - name: Build package dependencies + run: pnpm --filter "@cv/api..." --filter "@cv/client^..." build + + # apps/api/schema.gql is gitignored (CVG-100); regen here so the + # client's codegen:if-missing step has something to load. + - name: Generate GraphQL schema + run: pnpm --filter '@cv/api' schema:generate + - name: Build and deploy env: NPM_AUTH_TOKEN: ${{ steps.app-token.outputs.token }}