From a6a3b0eeebd25d825916f2f583804beb85e1d86a Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 07:46:21 +0100 Subject: [PATCH 01/22] ci: change yaml --- .github/{workflows => actions}/bump-version-save.yml | 0 .github/{workflows => actions}/publish.yml | 0 .github/workflows/{create-release.yaml => create-release.yml} | 4 ++-- .github/workflows/{e2e-test.yaml => e2e-test.yml} | 0 .github/workflows/pr.yml | 2 +- .github/workflows/{upload-badge.yaml => upload-badge.yml} | 0 6 files changed, 3 insertions(+), 3 deletions(-) rename .github/{workflows => actions}/bump-version-save.yml (100%) rename .github/{workflows => actions}/publish.yml (100%) rename .github/workflows/{create-release.yaml => create-release.yml} (96%) rename .github/workflows/{e2e-test.yaml => e2e-test.yml} (100%) rename .github/workflows/{upload-badge.yaml => upload-badge.yml} (100%) diff --git a/.github/workflows/bump-version-save.yml b/.github/actions/bump-version-save.yml similarity index 100% rename from .github/workflows/bump-version-save.yml rename to .github/actions/bump-version-save.yml diff --git a/.github/workflows/publish.yml b/.github/actions/publish.yml similarity index 100% rename from .github/workflows/publish.yml rename to .github/actions/publish.yml diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yml similarity index 96% rename from .github/workflows/create-release.yaml rename to .github/workflows/create-release.yml index 46c2daca..9ee0e4b3 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yml @@ -79,7 +79,7 @@ jobs: e2e-test: needs: [test] - uses: ./.github/workflows/e2e-test.yaml + uses: e2e-test.yml with: mainBranch: "last-tag" secrets: @@ -95,7 +95,7 @@ jobs: upload-badge: needs: [ test, e2e-test ] - uses: ./.github/workflows/upload-badge.yaml + uses: upload-badge.yml with: mainBranch: "last-tag" secrets: diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yml similarity index 100% rename from .github/workflows/e2e-test.yaml rename to .github/workflows/e2e-test.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index dc23c75c..b3a87baa 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -11,7 +11,7 @@ jobs: e2e-test: needs: [test] - uses: ./.github/workflows/e2e-test.yaml + uses: e2e-test.yml secrets: NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} diff --git a/.github/workflows/upload-badge.yaml b/.github/workflows/upload-badge.yml similarity index 100% rename from .github/workflows/upload-badge.yaml rename to .github/workflows/upload-badge.yml From 10ffb180f444568bd430d7a46783dbefbd840753 Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 07:52:32 +0100 Subject: [PATCH 02/22] ci: fix path in yml --- .github/workflows/create-release.yml | 4 ++-- .github/workflows/pr.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 9ee0e4b3..bb123d32 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -79,7 +79,7 @@ jobs: e2e-test: needs: [test] - uses: e2e-test.yml + uses: ./.github/workflows/e2e-test.yml with: mainBranch: "last-tag" secrets: @@ -95,7 +95,7 @@ jobs: upload-badge: needs: [ test, e2e-test ] - uses: upload-badge.yml + uses: ./.github/workflows/upload-badge.yml with: mainBranch: "last-tag" secrets: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b3a87baa..beac577e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -11,7 +11,7 @@ jobs: e2e-test: needs: [test] - uses: e2e-test.yml + uses: ./.github/workflows/e2e-test.yml secrets: NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} From 2198c402f4f3cc2a95c0fef4df2bcb4a37d8cf2b Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 08:57:31 +0100 Subject: [PATCH 03/22] ci: rename yml file --- .github/workflows/{create-release.yml => new-release.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{create-release.yml => new-release.yml} (99%) diff --git a/.github/workflows/create-release.yml b/.github/workflows/new-release.yml similarity index 99% rename from .github/workflows/create-release.yml rename to .github/workflows/new-release.yml index bb123d32..5fc25910 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/new-release.yml @@ -1,4 +1,4 @@ -name: 📦 Create Release +name: 📦 New Release defaults: &project_options - "" From 4e643b188ffa8a44c514a989490a93cc3fea2103 Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 09:05:08 +0100 Subject: [PATCH 04/22] ci: change property names yml file --- .github/workflows/new-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index 5fc25910..9ceed395 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -1,6 +1,6 @@ name: 📦 New Release -defaults: &project_options +projectDefaults: &project_options - "" - json-api-nestjs - json-api-nestjs-sdk @@ -70,7 +70,7 @@ jobs: project4: ${{ github.event.inputs.project4 }} test: - need: [compute-projects] + needs: [compute-projects] uses: ./.github/workflows/test.yml with: mainBranch: "last-tag" From e154db5bebfeb77511d5f4b7718cc92216911355 Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 09:11:44 +0100 Subject: [PATCH 05/22] ci: don't use YAML anchors for reuse GitHub Actions currently doesn't support YAML anchors, despite them being part of the YAML spec. This is a known issue - see actions/runner#1182 for more info --- .github/workflows/new-release.yml | 50 ++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index 9ceed395..ed9d8fac 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -1,15 +1,5 @@ name: 📦 New Release -projectDefaults: &project_options - - "" - - json-api-nestjs - - json-api-nestjs-sdk - - nestjs-json-rpc - - nestjs-json-rpc-sdk - - json-api-nestjs-microorm - - json-api-nestjs-shared - - json-api-nestjs-typeorm - on: workflow_dispatch: inputs: @@ -28,25 +18,57 @@ on: required: false default: "" type: choice - options: *project_options + options: + - "" + - json-api-nestjs + - json-api-nestjs-sdk + - nestjs-json-rpc + - nestjs-json-rpc-sdk + - json-api-nestjs-microorm + - json-api-nestjs-shared + - json-api-nestjs-typeorm project2: description: "Select project" required: false default: "" type: choice - options: *project_options + options: + - "" + - json-api-nestjs + - json-api-nestjs-sdk + - nestjs-json-rpc + - nestjs-json-rpc-sdk + - json-api-nestjs-microorm + - json-api-nestjs-shared + - json-api-nestjs-typeorm project3: description: "Select project" required: false default: "" type: choice - options: *project_options + options: + - "" + - json-api-nestjs + - json-api-nestjs-sdk + - nestjs-json-rpc + - nestjs-json-rpc-sdk + - json-api-nestjs-microorm + - json-api-nestjs-shared + - json-api-nestjs-typeorm project4: description: "Select project" required: false default: "" type: choice - options: *project_options + options: + - "" + - json-api-nestjs + - json-api-nestjs-sdk + - nestjs-json-rpc + - nestjs-json-rpc-sdk + - json-api-nestjs-microorm + - json-api-nestjs-shared + - json-api-nestjs-typeorm beta-release: description: 'Is beta release?' required: false From b4e22ca0b71fe7a09f3c76d43f33f4eff4c8c5c4 Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 09:23:25 +0100 Subject: [PATCH 06/22] ci: fix compute-projects.yml --- .github/workflows/compute-projects.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compute-projects.yml b/.github/workflows/compute-projects.yml index eb740adb..0496fd79 100644 --- a/.github/workflows/compute-projects.yml +++ b/.github/workflows/compute-projects.yml @@ -31,11 +31,13 @@ on: outputs: finalProjects: description: "Result Project" - value: ${{ steps.final.outputs.finalProjects }} + value: ${{ jobs.compute.outputs.finalProjects }} jobs: compute: runs-on: ubuntu-latest + outputs: + finalProjects: ${{ steps.final.outputs.finalProjects }} steps: - name: Checkout repository uses: actions/checkout@v4 From d7aa27309fdde8285b1cf9a17f80bee68fa2ceee Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 09:27:00 +0100 Subject: [PATCH 07/22] ci: fix upload-badge.yml --- .github/workflows/upload-badge.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/upload-badge.yml b/.github/workflows/upload-badge.yml index 7f1d7a83..9f260064 100644 --- a/.github/workflows/upload-badge.yml +++ b/.github/workflows/upload-badge.yml @@ -4,6 +4,7 @@ on: workflow_call: inputs: mainBranch: + type: string description: Type for main nx affect required: false default: "master" From 797de4831e340ad3496845894ec9752308f45244 Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 09:59:20 +0100 Subject: [PATCH 08/22] ci: fix env var --- .github/workflows/bump-version.yml | 4 ++-- .github/workflows/new-release.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index ddf27740..8c25a793 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -18,7 +18,7 @@ on: type: boolean default: false secrets: - NODE_AUTH_TOKEN: + NPM_TOKEN: required: true GITHUB_TOKEN_SECRET: required: true @@ -26,7 +26,7 @@ on: required: true env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN_SECRET }} NPM_CONFIG_PROVENANCE: true diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index ed9d8fac..f31ffa0a 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -133,6 +133,6 @@ jobs: beta-release: ${{ github.event.inputs.beta-release }} dry-run: ${{ github.event.inputs.dry-run }} secrets: - NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GITHUB_TOKEN_SECRET: ${{ secrets.GITHUB_TOKEN }} PAT: ${{secrets.PAT}} From bb7d8da8d2f893f737c8cc69dfc7d91caf6ff37b Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 10:14:43 +0100 Subject: [PATCH 09/22] ci: add fetch-depth: 0 to checkout --- .github/workflows/e2e-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index eb0eb231..cfce24dd 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -36,6 +36,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Setup Node.js uses: ./.github/actions From c27d06e5cdfd272a8e8d7bc49c29b99f695ce2b2 Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 10:53:05 +0100 Subject: [PATCH 10/22] ci: fix upload coverage badge --- .../json-api-nestjs-microorm/project.json | 5 ++++- .../json-api/json-api-nestjs-sdk/project.json | 19 +++++++++++++++++++ .../json-api-nestjs-shared/project.json | 18 +++++++++++++++++- .../json-api-nestjs-typeorm/project.json | 18 +++++++++++++++++- libs/json-api/json-api-nestjs/project.json | 7 +++++-- 5 files changed, 62 insertions(+), 5 deletions(-) diff --git a/libs/json-api/json-api-nestjs-microorm/project.json b/libs/json-api/json-api-nestjs-microorm/project.json index 04be98fb..7011ed28 100644 --- a/libs/json-api/json-api-nestjs-microorm/project.json +++ b/libs/json-api/json-api-nestjs-microorm/project.json @@ -46,7 +46,10 @@ ], "options": { "commands": [ - "node tools/scripts/upload-badge.mjs json-api-nestjs-microorm" + { + "command": "node tools/scripts/upload-badge.mjs json-api-nestjs-microorm", + "forwardAllArgs": false + } ], "cwd": "./", "parallel": false, diff --git a/libs/json-api/json-api-nestjs-sdk/project.json b/libs/json-api/json-api-nestjs-sdk/project.json index 7fa3ec1e..978ea0f2 100644 --- a/libs/json-api/json-api-nestjs-sdk/project.json +++ b/libs/json-api/json-api-nestjs-sdk/project.json @@ -89,6 +89,25 @@ "parallel": false } }, + "upload-badge": { + "executor": "nx:run-commands", + "dependsOn": [ + { + "target": "test" + } + ], + "options": { + "commands": [ + { + "command": "node tools/scripts/upload-badge.mjs json-api-nestjs-sdk", + "forwardAllArgs": false + } + ], + "cwd": "./", + "parallel": false, + "outputPath": "{workspaceRoot}/{projectRoot}" + } + }, "nx-release-publish": { "options": { "packageRoot": "dist/{projectRoot}" diff --git a/libs/json-api/json-api-nestjs-shared/project.json b/libs/json-api/json-api-nestjs-shared/project.json index 7696c291..a49a81e5 100644 --- a/libs/json-api/json-api-nestjs-shared/project.json +++ b/libs/json-api/json-api-nestjs-shared/project.json @@ -81,6 +81,19 @@ "parallel": false } }, + "test": { + "executor": "@nx/jest:jest", + "outputs": [ + "{workspaceRoot}/coverage/{projectRoot}" + ], + "options": { + "jestConfig": "{projectRoot}/jest.config.ts", + "codeCoverage": true, + "coverageReporters": [ + "json-summary" + ] + } + }, "upload-badge": { "executor": "nx:run-commands", "dependsOn": [ @@ -90,7 +103,10 @@ ], "options": { "commands": [ - "node tools/scripts/upload-badge.mjs json-api-nestjs-shared" + { + "command": "node tools/scripts/upload-badge.mjs json-api-nestjs-shared", + "forwardAllArgs": false + } ], "cwd": "./", "parallel": false, diff --git a/libs/json-api/json-api-nestjs-typeorm/project.json b/libs/json-api/json-api-nestjs-typeorm/project.json index 74981bfb..10a9c9b8 100644 --- a/libs/json-api/json-api-nestjs-typeorm/project.json +++ b/libs/json-api/json-api-nestjs-typeorm/project.json @@ -24,6 +24,19 @@ "packageRoot": "dist/{projectRoot}" } }, + "test": { + "executor": "@nx/jest:jest", + "outputs": [ + "{workspaceRoot}/coverage/{projectRoot}" + ], + "options": { + "jestConfig": "{projectRoot}/jest.config.ts", + "codeCoverage": true, + "coverageReporters": [ + "json-summary" + ] + } + }, "upload-badge": { "executor": "nx:run-commands", "dependsOn": [ @@ -33,7 +46,10 @@ ], "options": { "commands": [ - "node tools/scripts/upload-badge.mjs json-api-nestjs-typeorm" + { + "command": "node tools/scripts/upload-badge.mjs json-api-nestjs-typeorm", + "forwardAllArgs": false + } ], "cwd": "./", "parallel": false, diff --git a/libs/json-api/json-api-nestjs/project.json b/libs/json-api/json-api-nestjs/project.json index cba7e66b..dc351dbf 100644 --- a/libs/json-api/json-api-nestjs/project.json +++ b/libs/json-api/json-api-nestjs/project.json @@ -71,11 +71,14 @@ ], "options": { "commands": [ - "node tools/scripts/upload-badge.mjs json-api-nestjs" + { + "command": "node tools/scripts/upload-badge.mjs json-api-nestjs", + "forwardAllArgs": false + } ], "cwd": "./", "parallel": false, - "outputPath": "{workspaceRoot}/projectRoot}" + "outputPath": "{workspaceRoot}/{projectRoot}" } } }, From 66915cc781b98328534fe9bb014528db1e75189a Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 13:10:30 +0100 Subject: [PATCH 11/22] ci: fix upload coverage badge again --- libs/json-api/json-api-nestjs-microorm/project.json | 13 +++++++++++++ libs/json-api/json-api-nestjs-sdk/project.json | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/libs/json-api/json-api-nestjs-microorm/project.json b/libs/json-api/json-api-nestjs-microorm/project.json index 7011ed28..1a2d4b75 100644 --- a/libs/json-api/json-api-nestjs-microorm/project.json +++ b/libs/json-api/json-api-nestjs-microorm/project.json @@ -37,6 +37,19 @@ "updateBuildableProjectDepsInPackageJson": true } }, + "test": { + "executor": "@nx/jest:jest", + "outputs": [ + "{workspaceRoot}/coverage/{projectRoot}" + ], + "options": { + "jestConfig": "{projectRoot}/jest.config.ts", + "codeCoverage": true, + "coverageReporters": [ + "json-summary" + ] + } + }, "upload-badge": { "executor": "nx:run-commands", "dependsOn": [ diff --git a/libs/json-api/json-api-nestjs-sdk/project.json b/libs/json-api/json-api-nestjs-sdk/project.json index 978ea0f2..0a58414c 100644 --- a/libs/json-api/json-api-nestjs-sdk/project.json +++ b/libs/json-api/json-api-nestjs-sdk/project.json @@ -89,6 +89,19 @@ "parallel": false } }, + "test": { + "executor": "@nx/jest:jest", + "outputs": [ + "{workspaceRoot}/coverage/{projectRoot}" + ], + "options": { + "jestConfig": "{projectRoot}/jest.config.ts", + "codeCoverage": true, + "coverageReporters": [ + "json-summary" + ] + } + }, "upload-badge": { "executor": "nx:run-commands", "dependsOn": [ From e22ea8ce93bdfd27ced5a219871f75c3ec6424aa Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 13:59:08 +0100 Subject: [PATCH 12/22] ci: try fix parse boolean --- .github/workflows/new-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index f31ffa0a..7a3f4a16 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -130,8 +130,8 @@ jobs: uses: ./.github/workflows/bump-version.yml with: projects: ${{ needs.compute-projects.outputs.finalProjects }} - beta-release: ${{ github.event.inputs.beta-release }} - dry-run: ${{ github.event.inputs.dry-run }} + beta-release: ${{ fromJSON(github.event.inputs.beta-release) }} + dry-run: ${{ fromJSON(github.event.inputs.dry-run) }} secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GITHUB_TOKEN_SECRET: ${{ secrets.GITHUB_TOKEN }} From 8a2472b19d8501823c4d8af1713f2c767d78f1ae Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 14:21:24 +0100 Subject: [PATCH 13/22] ci: try fix bump version --- .github/workflows/bump-version.yml | 8 +++- .github/workflows/new-release.yml | 71 +++++++++++++++--------------- 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 8c25a793..a7e24d67 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -20,19 +20,23 @@ on: secrets: NPM_TOKEN: required: true - GITHUB_TOKEN_SECRET: + GITHUB_TOKEN: required: true PAT: required: true env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN_SECRET }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_CONFIG_PROVENANCE: true jobs: bump-version: runs-on: ubuntu-latest + permissions: + contents: "write" + actions: "read" + id-token: "write" steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index 7a3f4a16..a18ab638 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -91,42 +91,43 @@ jobs: project3: ${{ github.event.inputs.project3 }} project4: ${{ github.event.inputs.project4 }} - test: - needs: [compute-projects] - uses: ./.github/workflows/test.yml - with: - mainBranch: "last-tag" - secrets: - NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} - - e2e-test: - needs: [test] - uses: ./.github/workflows/e2e-test.yml - with: - mainBranch: "last-tag" - secrets: - NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} - - build: - needs: [test, e2e-test] - uses: ./.github/workflows/build.yml - with: - mainBranch: "last-tag" - secrets: - NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} - - upload-badge: - needs: [ test, e2e-test ] - uses: ./.github/workflows/upload-badge.yml - with: - mainBranch: "last-tag" - secrets: - NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} - GIST_SECRET: ${{ secrets.GIST_SECRET }} - GIST_ID: ${{ secrets.GIST_ID }} +# test: +# needs: [compute-projects] +# uses: ./.github/workflows/test.yml +# with: +# mainBranch: "last-tag" +# secrets: +# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} +# +# e2e-test: +# needs: [test] +# uses: ./.github/workflows/e2e-test.yml +# with: +# mainBranch: "last-tag" +# secrets: +# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} +# +# build: +# needs: [test, e2e-test] +# uses: ./.github/workflows/build.yml +# with: +# mainBranch: "last-tag" +# secrets: +# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} +# +# upload-badge: +# needs: [ test, e2e-test ] +# uses: ./.github/workflows/upload-badge.yml +# with: +# mainBranch: "last-tag" +# secrets: +# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} +# GIST_SECRET: ${{ secrets.GIST_SECRET }} +# GIST_ID: ${{ secrets.GIST_ID }} bump-version: - needs: [build] +# needs: [build] + needs: [compute-projects] uses: ./.github/workflows/bump-version.yml with: projects: ${{ needs.compute-projects.outputs.finalProjects }} @@ -134,5 +135,5 @@ jobs: dry-run: ${{ fromJSON(github.event.inputs.dry-run) }} secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - GITHUB_TOKEN_SECRET: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PAT: ${{secrets.PAT}} From c689f39d6efff96430825e3e8776e142937c5525 Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 14:26:45 +0100 Subject: [PATCH 14/22] ci: try fix bump version gain --- .github/workflows/bump-version.yml | 4 ++-- .github/workflows/new-release.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index a7e24d67..7717b0a1 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -20,14 +20,14 @@ on: secrets: NPM_TOKEN: required: true - GITHUB_TOKEN: + GITHUB_TOKEN_SECRET: required: true PAT: required: true env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN_SECRET }} NPM_CONFIG_PROVENANCE: true jobs: diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index a18ab638..8aaec0f1 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -135,5 +135,5 @@ jobs: dry-run: ${{ fromJSON(github.event.inputs.dry-run) }} secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN_SECRET: ${{ secrets.GITHUB_TOKEN }} PAT: ${{secrets.PAT}} From 872d896be414f1097f1e73631939d1b5f57f1b6b Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 15:05:59 +0100 Subject: [PATCH 15/22] ci: try fix bump version gain 2 --- .github/workflows/bump-version.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 7717b0a1..03bc3364 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -43,6 +43,7 @@ jobs: with: fetch-depth: 0 token: ${{ secrets.PAT }} + persist-credentials: true - name: Npm install uses: ./.github/actions - name: Bump version From 418b9e3070a7d6d04341ddefcde137904181cd50 Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 15:19:37 +0100 Subject: [PATCH 16/22] ci: try fix bump version gain 3 --- .github/workflows/bump-version.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 03bc3364..daabacb9 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -38,6 +38,10 @@ jobs: actions: "read" id-token: "write" steps: + - name: Settings git + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" - name: Checkout repository uses: actions/checkout@v4 with: @@ -47,8 +51,5 @@ jobs: - name: Npm install uses: ./.github/actions - name: Bump version - run: | - git config --global user.email "actions@github.com" - git config --global user.name "GitHub Actions" npx nx release --skip-publish --projects=${{ inputs.projects }} --dry-run=${{ inputs.dry-run }} shell: bash From ece25549597ab55b0ce9c448c209cb38f33edd39 Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 15:20:53 +0100 Subject: [PATCH 17/22] ci: try fix bump version gain 4 --- .github/workflows/bump-version.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index daabacb9..b2deb6fb 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -51,5 +51,6 @@ jobs: - name: Npm install uses: ./.github/actions - name: Bump version + run: | npx nx release --skip-publish --projects=${{ inputs.projects }} --dry-run=${{ inputs.dry-run }} shell: bash From e731b1ee79cfe0b6bee22aacdf0afb442fc1829c Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 15:26:42 +0100 Subject: [PATCH 18/22] ci: try fix bump version gain 5 --- .github/workflows/bump-version.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index b2deb6fb..f9eb7aa8 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -46,7 +46,6 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - token: ${{ secrets.PAT }} persist-credentials: true - name: Npm install uses: ./.github/actions From 06558d02bbe2cd7b2dbb416e199422ddac05acdd Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 15:45:57 +0100 Subject: [PATCH 19/22] ci: try use beta params --- .github/workflows/bump-version.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index f9eb7aa8..b428a1b2 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -51,5 +51,10 @@ jobs: uses: ./.github/actions - name: Bump version run: | - npx nx release --skip-publish --projects=${{ inputs.projects }} --dry-run=${{ inputs.dry-run }} + if [ "${{ inputs.beta-release }}" = "true" ]; then + npx nx release --skip-publish --projects=${{ inputs.projects }} --dry-run=${{ inputs.dry-run }} --preid=beta + else + npx nx release --skip-publish --projects=${{ inputs.projects }} --dry-run=${{ inputs.dry-run }} + fi shell: bash + From 5cdd8ceff6d24645865725f57fa6501c3b029ea8 Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 16:26:11 +0100 Subject: [PATCH 20/22] ci: publish job --- .github/workflows/new-release.yml | 76 +++++++++++++++++-------------- .github/workflows/publish.yml | 29 ++++++++++++ 2 files changed, 70 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index 8aaec0f1..35a04a6b 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -91,43 +91,42 @@ jobs: project3: ${{ github.event.inputs.project3 }} project4: ${{ github.event.inputs.project4 }} -# test: -# needs: [compute-projects] -# uses: ./.github/workflows/test.yml -# with: -# mainBranch: "last-tag" -# secrets: -# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} -# -# e2e-test: -# needs: [test] -# uses: ./.github/workflows/e2e-test.yml -# with: -# mainBranch: "last-tag" -# secrets: -# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} -# -# build: -# needs: [test, e2e-test] -# uses: ./.github/workflows/build.yml -# with: -# mainBranch: "last-tag" -# secrets: -# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} -# -# upload-badge: -# needs: [ test, e2e-test ] -# uses: ./.github/workflows/upload-badge.yml -# with: -# mainBranch: "last-tag" -# secrets: -# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} -# GIST_SECRET: ${{ secrets.GIST_SECRET }} -# GIST_ID: ${{ secrets.GIST_ID }} + test: + needs: [compute-projects] + uses: ./.github/workflows/test.yml + with: + mainBranch: "last-tag" + secrets: + NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} + + e2e-test: + needs: [test] + uses: ./.github/workflows/e2e-test.yml + with: + mainBranch: "last-tag" + secrets: + NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} + + build: + needs: [test, e2e-test] + uses: ./.github/workflows/build.yml + with: + mainBranch: "last-tag" + secrets: + NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} + + upload-badge: + needs: [ test, e2e-test ] + uses: ./.github/workflows/upload-badge.yml + with: + mainBranch: "last-tag" + secrets: + NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} + GIST_SECRET: ${{ secrets.GIST_SECRET }} + GIST_ID: ${{ secrets.GIST_ID }} bump-version: -# needs: [build] - needs: [compute-projects] + needs: [build] uses: ./.github/workflows/bump-version.yml with: projects: ${{ needs.compute-projects.outputs.finalProjects }} @@ -137,3 +136,10 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GITHUB_TOKEN_SECRET: ${{ secrets.GITHUB_TOKEN }} PAT: ${{secrets.PAT}} + + publish: + if: ${{ fromJSON(github.event.inputs.dry-run) == false }} + needs: [bump-version] + uses: ./.github/workflows/publish.yml + secrets: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..4bfd232d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,29 @@ +name: ⚙️ Publish + + +on: + workflow_call: + secrets: + NPM_TOKEN: + required: true + +env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_CONFIG_PROVENANCE: true + +jobs: + publish: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: ./.github/actions + + - name: Build + run: npx nx affected -t build --parallel=3 --exclude='*,!tag:type:publish' + + - name: Publish packages + run: npx nx release publish + From d307678a7f5310b29ba17992ee2c5122b30ccca6 Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 16:55:57 +0100 Subject: [PATCH 21/22] test(json-api-server-e2e): Add test for check validation for null Closes: #107 --- .../src/json-api/json-api-sdk/patch-methode.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/json-api-server-e2e/src/json-api/json-api-sdk/patch-methode.spec.ts b/apps/json-api-server-e2e/src/json-api/json-api-sdk/patch-methode.spec.ts index 5a2d61d6..e603de0c 100644 --- a/apps/json-api-server-e2e/src/json-api/json-api-sdk/patch-methode.spec.ts +++ b/apps/json-api-server-e2e/src/json-api/json-api-sdk/patch-methode.spec.ts @@ -129,6 +129,7 @@ describe('PATCH method:', () => { userWithEmptyAttr.id = userAfterSave.id; userWithEmptyAttr.addresses = newAddressAfterSave; userWithEmptyAttr.comments = [newCommentsAfterSave]; + userWithEmptyAttr.lastName = null as any; await jsonSdk.jonApiSdkService.patchOne(userWithEmptyAttr); const userAfterUpdate = await jsonSdk.jonApiSdkService.getOne( From 4fa5cf50f7829e65e53d4d63b083d21f65940c06 Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Mar 2025 17:16:10 +0100 Subject: [PATCH 22/22] ci: Fix publish.yml --- .github/workflows/publish.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4bfd232d..337d8b10 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,17 +13,19 @@ env: jobs: publish: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Setup Node.js - uses: ./.github/actions + - name: Setup Node.js + uses: ./.github/actions - - name: Build - run: npx nx affected -t build --parallel=3 --exclude='*,!tag:type:publish' + - name: Build + run: npx nx affected -t build --parallel=3 --exclude='*,!tag:type:publish' - - name: Publish packages - run: npx nx release publish + - name: Publish packages + run: npx nx release publish