Skip to content

Commit a7d4629

Browse files
committed
chore: upgrade nestjs to v11 and improve infrastructure (#1212) (#1213)
* feat(workspace): migrate to pnpm workspace and update nestjs dependencies - Migrated from npm/yarn to pnpm workspace for better monorepo management - Updated NestJS dependencies to latest version - Fixed GraphQL middleware configuration * ci(workflow): migrate to pnpm-based test workflow - Remove legacy workflow configurations - Add new test workflow with PNPM setup - Configure test environment and secrets - Set up coverage reporting * ci(workflow): implement changesets for automated releases - Add changesets configuration and scripts - Configure GitHub Actions workflow for automated releases - Update publish workflow with proper NPM authentication
1 parent 5135201 commit a7d4629

16 files changed

+11652
-32438
lines changed

.changeset/config.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": ["@changesets/cli/changelog-github", { "repo": "Lokicoule/nestjs-cognito" }],
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch"
10+
}

.github/actions/ci-setup/action.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Setup CI
2+
description: Sets up Node.js, PNPM and installs dependencies
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Install pnpm
8+
uses: pnpm/action-setup@v4
9+
with:
10+
version: 'latest'
11+
12+
- name: Setup Node.js
13+
uses: actions/setup-node@v4
14+
with:
15+
node-version: 'lts/iron'
16+
cache: 'pnpm'
17+
18+
- name: Install dependencies
19+
run: pnpm install --no-frozen-lockfile
20+
shell: bash
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3-
4-
name: Node.js CI
1+
name: Coverage
52

63
on:
74
push:
@@ -28,35 +25,25 @@ env:
2825
RAY_PASSWORD: ${{ secrets.RAY_PASSWORD }}
2926

3027
jobs:
31-
build:
28+
test:
3229
runs-on: ${{ matrix.os }}
3330
environment: production
3431
strategy:
3532
matrix:
36-
node-version: [18.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
33+
node-version: [18.x]
3734
os: [ubuntu-latest]
3835

3936
steps:
4037
- uses: actions/checkout@v4
41-
- name: Use Node.js ${{ matrix.node-version }}
42-
uses: actions/setup-node@v4
43-
with:
44-
node-version: ${{ matrix.node-version }}
45-
cache: "npm"
46-
47-
- name: Generate package.lock.json
48-
run: npm i --package-lock
49-
50-
- name: Install dependencies
51-
run: npm ci && lerna exec npm i
38+
- uses: ./.github/actions/ci-setup
5239

5340
- name: Build
54-
run: npm run build
41+
run: pnpm run build
5542

5643
- name: Tests coverage
57-
run: npm run coverage
44+
run: pnpm run coverage
5845

5946
- name: Coveralls
6047
uses: coverallsapp/github-action@master
6148
with:
62-
github-token: ${{ secrets.GITHUB_TOKEN }}
49+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/npm-publish.yml

-59
This file was deleted.

.github/workflows/publish.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
paths:
7+
- '.changeset/**'
8+
- 'CHANGELOG.md'
9+
pull_request:
10+
branches: ['main']
11+
paths:
12+
- '.changeset/**'
13+
- 'CHANGELOG.md'
14+
workflow_dispatch:
15+
16+
permissions:
17+
contents: write
18+
pull-requests: write
19+
20+
concurrency:
21+
group: release-${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
23+
24+
jobs:
25+
coverage:
26+
uses: ./.github/workflows/coverage.yml
27+
28+
release:
29+
needs: [coverage]
30+
runs-on: ubuntu-latest
31+
environment: production
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
38+
- name: Setup Build Environment
39+
uses: ./.github/actions/ci-setup
40+
41+
- name: Check for changesets
42+
run: pnpm changeset status --since=main
43+
44+
- name: Build
45+
run: pnpm run build
46+
47+
- name: Create Release Pull Request or Publish
48+
id: changesets
49+
uses: changesets/action@v1
50+
with:
51+
publish: pnpm run release
52+
commit: "chore: version packages"
53+
title: "chore: version packages"
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
57+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

lerna.json

-19
This file was deleted.

0 commit comments

Comments
 (0)