diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 3cf9f51c..d9efacb2 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -99,6 +99,28 @@ jobs: docker push ghcr.io/${{ github.repository }}/${{ matrix.image }}:${{ steps.extract_ref.outputs.ref_name }} docker push ghcr.io/${{ github.repository }}/${{ matrix.image }}:latest + build-package: + working-directory: backend + runs-on: ubuntu-latest + needs: + - upstream-workflows + - verify-version-strings + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22.x + cache: 'npm' + registry-url: 'https://npm.pkg.github.com' + scope: '@codecentric' + cache-dependency-path: backend/package-lock.json + - run: npm ci + - run: npm version ${{ steps.extract_ref.outputs.version }} + - run: npm run build:lib + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + publish-helm-chart: name: Publish Helm Chart runs-on: ubuntu-latest diff --git a/backend/package-lock.json b/backend/package-lock.json index 4e5aed5d..3ca49214 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -1,12 +1,12 @@ { - "name": "c4-genai-suite", - "version": "0.0.1", + "name": "@codecentric/c4-genai-suite-backend", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "c4-genai-suite", - "version": "0.0.1", + "name": "@codecentric/c4-genai-suite-backend", + "version": "1.0.0", "license": "Apache-2.0", "dependencies": { "@langchain/aws": "0.1.10", diff --git a/backend/package.json b/backend/package.json index 51fc3b75..d8a74188 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,12 +1,19 @@ { - "name": "c4-genai-suite", - "version": "0.0.1", + "name": "@codecentric/c4-genai-suite-backend", + "version": "1.0.0", "description": "", "author": "", - "private": true, "license": "Apache-2.0", + "publishConfig": { + "access": "public", + "registry": "https://npm.pkg.github.com" + }, + "repository": { + "url": "https://github.com/codecentric/c4-genai-suite.git" + }, "scripts": { "build": "nest build", + "build:lib": "tsc -p tsconfig.lib.json", "format": "prettier --write \"src/**/*.ts\"", "start": "nest start", "dev": "nest start", diff --git a/backend/src/index.ts b/backend/src/index.ts new file mode 100644 index 00000000..20baac2a --- /dev/null +++ b/backend/src/index.ts @@ -0,0 +1,5 @@ +export * from 'src/domain/auth/interfaces'; +export * from 'src/domain/chat/interfaces'; +export * from 'src/domain/extensions/interfaces'; +export * from 'src/domain/files/interfaces'; +export * from 'src/domain/shared'; diff --git a/backend/tsconfig.lib.json b/backend/tsconfig.lib.json new file mode 100644 index 00000000..8119af9a --- /dev/null +++ b/backend/tsconfig.lib.json @@ -0,0 +1,5 @@ +{ + "extends": "./tsconfig.json", + "include": ["src/index.ts", "src/domain/**/*.ts"], + "exclude": ["node_modules", "dist", "**/*spec.ts", "jest.*.ts"] +}